我正在尝试使用Selenium Webdriver python点击网站上的按钮,我看到按钮突出显示,但没有使用a id="btn_Reset" class="top_btn" onclick="Reset();" href="#">Reboot< /a
功能点击。
下面是我试图点击按钮的html代码
inputElement = driver.find_element_by_id("btn_Reset").click()
我正在尝试使用id
点击按钮inputElement = driver.find_element_by_xpath("/html/body/div[8]/div/div[2]/div[1]/ul/li[3]/a").click()
我也试过xpath,结果相同
File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/pkg_resources.py", line 728, in require
needed = self.resolve(parse_requirements(requirements))
File "/opt/rh/python33/root/usr/lib/python3.3/site-packages/pkg_resources.py", line 630, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (six 1.3.0 (/opt/rh/python33/root/usr/lib/python3.3/site-packages), Requirement.parse('six>=1.5'))
答案 0 :(得分:0)
这样做可能是一件愚蠢的事情:
inputElement = driver.find_element_by_id("btn_Reset")
inputElement.click()