Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/300.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Selenium/Python,如何查找和调用特定HTML文本作为超链接的Javascript函数?_Python_Selenium - Fatal编程技术网

Selenium/Python,如何查找和调用特定HTML文本作为超链接的Javascript函数?

Selenium/Python,如何查找和调用特定HTML文本作为超链接的Javascript函数?,python,selenium,Python,Selenium,使用Selenium/Python,如何找到该元素并单击 getZipFile()中的参数是随机的,可能不同,并且有多个getZipFile()引用 在HTML中,但只有一个包含文本All尝试通过链接文本查找: driver.find_element_by_link_text("All").click() 或xpath: driver.find_element_by_xpath("//a[contains(@href, 'getZipFile') and text()='All']").cl

使用Selenium/Python,如何找到该元素并单击

getZipFile()
中的参数是随机的,可能不同,并且有多个
getZipFile()
引用


在HTML中,但只有一个包含文本
All

尝试通过
链接文本查找:

driver.find_element_by_link_text("All").click()
xpath

driver.find_element_by_xpath("//a[contains(@href, 'getZipFile') and text()='All']").click()

好的,行了。现在它开始下载ZIP文件,但在左下角的消息区域中立即显示“失败”,该消息区域跟踪/显示下载进度。没有解释为什么。设置为转到的目录存在,并且对每个人都有读/写权限。