我试图填补this form以改善我的工作,我尝试了硒,但出现了一些问题:
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: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@name='dtype[cTqIlcPGbjsk_cIuZdPSoQ]' and @id='dtype_cTqIlcPGbjsk_cIuZdPSoQ']"}
我也试过:
fill = driver.find_element_by_xpath("//input[@name='dtype[cTqIlcPGbjsk_cIuZdPSoQ]' and @id='dtype_cTqIlcPGbjsk_cIuZdPSoQ']").click()[0]
但还是不起作用,知道吗
将
.click()
带到下一行:输出:
您的代码无法工作,因为您已将
.click()
函数的输出分配给变量fill
。当您打印出代码中的填充类型时,它将打印以下内容:输出:
类型为
NoneType
的变量没有名为.send_keys()
的函数。因此,您的代码不起作用相关问题 更多 >
编程相关推荐