【发布时间】:2020-10-12 11:50:26
【问题描述】:
我正在尝试填写 this form 以改善我的工作,我尝试使用 Selenium 但出现问题:
driver= webdriver.Chrome('/Users/48604/Desktop/kyk/chromedriver')
driver.get('https://quintadb.com/widgets/cCsqTdWRnaWPBdGb4zgCkg/c_mw7dRmneW4mgWQzrFdOq')
fill = driver.find_element_by_xpath("//input[@name='dtype[cTqIlcPGbjsk_cIuZdPSoQ]' and @id='dtype_cTqIlcPGbjsk_cIuZdPSoQ']").click()
fill.send_keys('test')
但我收到错误:
selenium.common.exceptions.NoSuchElementException: 消息:没有这样的 元素:无法定位元素: {"method":"xpath","selector":"//输入[@name='dtype[cTqIlcPGbjsk_cIuZdPSoQ]' 和@id='dtype_cTqIlcPGbjsk_cIuZdPSoQ']"}
我也试过了:
fill = driver.find_element_by_xpath("//input[@name='dtype[cTqIlcPGbjsk_cIuZdPSoQ]' and @id='dtype_cTqIlcPGbjsk_cIuZdPSoQ']").click()[0]
但仍然无法正常工作,有什么想法吗?
【问题讨论】:
标签: python selenium selenium-webdriver web-scraping selenium-chromedriver