简体   繁体   English

Python-分裂点击

[英]Python - Splinter click

I am trying to click on list item with below python script. 我正在尝试使用以下python脚本单击列表项。

from splinter import Browser

from bs4 import BeautifulSoup as bs
url ='https://astrogeology.usgs.gov/search/results?q=hemisphere+enhanced&k1=target&v1=Mars'
browser.visit(url)

browser.find_by_css("a.product-item").click()

and this gives me WebDriverException with below message. 这给了我WebDriverException与以下消息。 Any help please? 有什么帮助吗?

Message: unknown error: Element <a href="/search/map/Mars/Viking/cerberus_enhanced" class="itemLink product-item">...</a> is not clickable at point (54, 228). 消息:未知错误:元素<a href="/search/map/Mars/Viking/cerberus_enhanced" class="itemLink product-item">...</a>在点( <a href="/search/map/Mars/Viking/cerberus_enhanced" class="itemLink product-item">...</a> )不可单击。 Other element would receive the click: <section id="results-accordian" class="block">...</section> 其他元素将获得点击: <section id="results-accordian" class="block">...</section>

I am new but when I tried your code and get the same error. 我是新手,但是当我尝试您的代码并遇到相同的错误时。 I went through the dev tools and it seems the element is not located properly thus confusing selenium. 我经历了开发工具,似乎该元素的位置不正确,从而导致硒混乱。

this may help 这可能会有所帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM