def collectArticle(self, link: str) -> None:
"""
Goes through the posts on the given page and saves 'em screenshots, which will later on be used.
"""
time.sleep(.2)
self.driver.get(link)
self.driver.execute_script("document.body.style.zoom='80%'")
self.wait.until(EC.presence_of_all_elements_located((By.XPATH, searchConfig.facebook['properties']['articles'])))
self.wait.until(EC.element_to_be_clickable((By.XPATH, '//div[@role="main"]')))
self.wait.until(EC.presence_of_element_located((By.XPATH, '//div[@role="main"]')))
self.wait.until(EC.visibility_of_element_located((By.XPATH, '//div[@role="main"]')))
articles: List[WebElement] = self.driver.find_elements(By.XPATH, searchConfig.facebook['properties']['articles'])
print(len(articles))
for article in articles:
try:
time.sleep(2)
self.ac.move_to_element_with_offset(article, 0, 100).perform()
time.sleep(config.scrollTimePause)
print(article)
# self.takeScreenshot(article.screenshot_as_png, f'facebook{random.randint(1, 100)}.png')
except sex.WebDriverException as e:
print(e.msg)
continue
Почему он вылетает стейл еррор? Я же явно жду этого элемента, на страничке он есть, на экране - тоже. Я уже даже тайм слипы раскидал, мало ли.