私はブラウザとしてChromeでセレンのPythonを使ってWebページ上のすべてのPDFファイルをダウンロードしようとしているが、セッションは、このメッセージで終わるたび:セレンPythonのStaleElementReferenceException
:StaleElementReferenceException: stale element reference: element is not attached to the page document
(Session info: chrome=52.0.2743.116)
(Driver info: chromedriver=2.22.397933
これはコードです
def download_pdf(self):
current = self.driver.current_url
lista_link_temp = self.driver.find_elements_by_xpath("//*[@href]")
for link in lista_link_temp:
if "pdf+html" in str(link.get_attribute("href")):
tutor = link.get_attribute("href")
self.driver.get(str(tutor))
self.driver.get(current)
私を助けてください..私はちょうどラムダ、暗黙的および明示的な待機を試してみた
おかげ
素晴らしい!できます!ありがとう。私は希望を失っていた.. – LBdoc
@LBdocそれを聞いてうれしい! – elethan