【发布时间】:2015-09-28 16:12:49
【问题描述】:
我已经建立了一个抓取网址的网络爬虫。它偶尔会出现问题(并非一直发生)。我在代码的这个特定部分得到了TimeOutException:
tries = 0
while tries<1000:
try:
domain=wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, "cite._Rm")))
domain = domain.text
break
except StaleElementReferenceException:
tries+=1
self.browser.refresh()
错误:
文件“”,第 389 行,在 findDomains 中 domain=wait.until(EC.presence_of_element_located((By.CSS_SELECTOR, "cite._Rm"))) 文件“”,第 78 行,直到 raise TimeoutException(message, screen, stacktrace) TimeoutException: Message:
【问题讨论】:
-
您在问题中显示的代码不会运行。
标签: python selenium selenium-webdriver selenium-chromedriver