mirror of
https://github.com/quatalog/quatalog.git
synced 2024-09-28 20:48:57 +00:00
Compare commits
No commits in common. "9c374bf13088602042905bbbb43be5144b030ae3" and "aec272e28efb0930fbf60ffc70c58046dd87b2a6" have entirely different histories.
9c374bf130
...
aec272e28e
2
.github/workflows/transfer.yml
vendored
2
.github/workflows/transfer.yml
vendored
|
@ -75,7 +75,7 @@ jobs:
|
|||
|
||||
- name: Combine JSONs
|
||||
run: |
|
||||
cat new-data/* | jq -s 'add | sort_by(.institution)' > data/transfer.json
|
||||
cat new-data/* | jq -s 'add' > data/transfer.json
|
||||
|
||||
- name: Commit data
|
||||
working-directory: data
|
||||
|
|
|
@ -29,7 +29,7 @@ def wait(ec):
|
|||
global driver
|
||||
|
||||
WebDriverWait(
|
||||
driver, 35, ignored_exceptions=[StaleElementReferenceException]
|
||||
driver, 40, ignored_exceptions=[StaleElementReferenceException]
|
||||
).until(ec)
|
||||
sleep(random.uniform(400, 1900) / 1000)
|
||||
|
||||
|
@ -44,7 +44,6 @@ def wait(ec):
|
|||
def jump_to_page(curr_page, to_page, postback_type, pagination_type):
|
||||
global driver
|
||||
|
||||
wait(EC.visibility_of_element_located((By.ID, postback_type)))
|
||||
page = driver.find_element(By.ID, postback_type)
|
||||
try:
|
||||
num_pages = int(driver.find_element(By.ID, pagination_type).text.split()[-1])
|
||||
|
@ -101,7 +100,7 @@ def scrape_page(page_num):
|
|||
except Exception as e:
|
||||
driver.quit()
|
||||
print(
|
||||
f"Attempt {i} failed due to {type(e).__name__}, retrying in 25 seconds...",
|
||||
f"Attempt {i} failed to load page, retrying in 25 seconds...",
|
||||
file=sys.stderr,
|
||||
)
|
||||
sleep(25)
|
||||
|
@ -126,7 +125,7 @@ def scrape_institution_safe(index, page_num):
|
|||
except Exception as e:
|
||||
driver.quit()
|
||||
print(
|
||||
f"\tAttempt {i} failed due to {type(e).__name__}, retrying in 25 seconds...",
|
||||
f"\tAttempt {i} failed due to {type(e).__name__}: {e}, retrying in 25 seconds...",
|
||||
file=sys.stderr,
|
||||
)
|
||||
sleep(25)
|
||||
|
|
Loading…
Reference in a new issue