社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Python

HTML Selenium Python点击href链接

mathias5986 • 4 年前 • 1990 次点击  

我想写一个python代码,他点击href链接。

HTML的截图: screenshot of HTML code

这是我目前在Python中使用的,但它不起作用。

tables = browser.find_elements_by_xpath('//*[@id="notice"]')

for table in tables:
     row = table.find_element_by_xpath('//tr[@class="Zebra"]//td//a[@href="https://enot.publicprocurement.be/enot-war/preViewNotice.do?noticeId=438868&saveSearchParams=true&pageSize=%31%32%35&d-446978-p=%31&"]').click()

这是第行的错误消息:

NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//tr[@class="Zebra"]//td//a[@href="https://enot.publicprocurement.be/enot-war/preViewNotice.do?noticeId=438868&saveSearchParams=true&pageSize=%31%32%35&d-446978-p=%31&"]"}

你能告诉我我做错了什么吗?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/131502
文章 [ 1 ]  |  最新文章 4 年前