【发布时间】:2021-09-16 20:41:49
【问题描述】:
我要抓取的链接是https://hcad.org/property-search/real-property/real-property-search-by-account-number/
我目前正在使用这种方法
driver.get('https://hcad.org/property-search/real-property/real-property-search-by-account-number/')
driver.implicitly_wait(2)
driver.find_element_by_xpath('/html/body/div[1]/div[3]/div/h1').click()
actions.send_keys(Keys.TAB * 2 )
actions.send_keys(account_num)
actions.send_keys(Keys.TAB)
actions.send_keys(Keys.RETURN)
actions.perform()
在搜索框中输入帐号并搜索它,这给了我一个新表格。
我尝试使用完整的 xpath 来查找输入区域,但它始终无法正常工作。
无论如何我可以使用元素 xpath 编写帐户编号,或者我可以超出操作方法以外的表单元素。
我尝试了不同的方法。
就像使用驱动程序隐式等待功能使用(id,full xpath)搜索输入区域但它们都不起作用请在这里帮助我,以便我可以使用您的方法在输入帐号后获取的表单上获取元素我迷路了。
【问题讨论】:
标签: python selenium xpath iframe css-selectors