簡體   English   中英

Python-分裂點擊

[英]Python - Splinter click

我正在嘗試使用以下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()

這給了我WebDriverException與以下消息。 有什么幫助嗎?

消息:未知錯誤:元素<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> )不可單擊。 其他元素將獲得點擊: <section id="results-accordian" class="block">...</section>

我是新手,但是當我嘗試您的代碼並遇到相同的錯誤時。 我經歷了開發工具,似乎該元素的位置不正確,從而導致硒混亂。

這可能會有所幫助

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM