Skip to content

Commit 7e3d940

Browse files
authored
Merge pull request #6 from Duckweeds7/master
The function wait.until does not seem to wait for loading bar.
2 parents ee6f94b + 6dd48a8 commit 7e3d940

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cygnusx1/scraper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ def _scrap_google_page_image_urls(page_url: str, thread_id: int, headless: bool
6161
# wait.until(WaitLoad(loading_bar))
6262
if "display" in (str(loading_bar.get_attribute('style'))):
6363
wait.until(lambda _: 'display: none' in str(loading_bar.get_attribute('style')))
64+
# It seems that the above code doesn't work, and all the downloads are thumbnails.
65+
# The following code has been tested to work properly
66+
while 'display: none' not in str(loading_bar.get_attribute('style')):
67+
time.sleep(1)
6468
images = browser.find_elements(By.XPATH, GOOGLE_IMAGE_FULLSIZE_XPATH)
6569
for img in images:
6670
highlight(browser, img)

0 commit comments

Comments
 (0)