我想点击一个<a>
标签,它看起来像一个我可以用 selenium 内置函数点击的元素click()
。我想知道是否有人可以解释如何确定这样的元素是否真的可以点击以用于未来的硒编码。谢谢
HTML:
<a class="open" data-path="/public/employees/767772/description.json" href="javascript:;" style="display: inline;">
<span class="icon-caret-right"></span><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> Läs mer
</font></font></a>
当我尝试时,我得到的只是一个错误:
DevTools listening on ws://127.0.0.1:56906/devtools/browser/a65af20c-af35-4f09-8390-abce557b8b87
Traceback (most recent call last):
File "c:/Users/hugom/OneDrive/Documents/python web scraping tut/csv tutorials/freelancer.py", line 79, in <module>
a_tag.click()
File "C:\Users\hugom\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
self._execute(Command.CLICK_ELEMENT)
File "C:\Users\hugom\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "C:\Users\hugom\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\hugom\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <a class="open" data-path="/public/employees/118883/description.json" href="javascript:;">...</a> is not clickable at point (458, 1242). Other element would receive the click: <img alt="テレビCM放映中!" src="https://cw-assets.crowdworks.jp/assets/banners/fixedfooter-20200104-2000x200-5e5bc753cfe393c01c5797c1647b4fd732631e477d4308cc653f4d994f541200.png" width="1000" height="100">
(Session info: chrome=85.0.4183.102)