Selenium control loop
This commit is contained in:
1 parent
9083021674
commit
f729bd1cb2
1 file changed
+2
-1
@@ -53,9 +53,10 @@ class MissingKidsFetcher():
|
|||||||
results = {"status": "invalid"}
|
results = {"status": "invalid"}
|
||||||
else:
|
else:
|
||||||
# Check until finished loading
|
# Check until finished loading
|
||||||
num_checks = 3
|
num_checks = 5
|
||||||
while (not load_finished(driver)) and (num_checks>=0):
|
while (not load_finished(driver)) and (num_checks>=0):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
num_checks -= 1
|
||||||
|
|
||||||
# Find all <img> tags with src attributes. Extract src URLs
|
# Find all <img> tags with src attributes. Extract src URLs
|
||||||
image_urls = [img.get_attribute("src") for img in driver.find_elements(By.XPATH, "//img[@src]")]
|
image_urls = [img.get_attribute("src") for img in driver.find_elements(By.XPATH, "//img[@src]")]
|
||||||
|
|||||||
Reference in new issue
Block a user