fix handling of db result -> dict
This commit is contained in:
@@ -141,9 +141,12 @@ def scraper():
|
|||||||
job_urls = db_get_all_job_urls()
|
job_urls = db_get_all_job_urls()
|
||||||
yield f"Processing {len(job_urls)} job pages...\n"
|
yield f"Processing {len(job_urls)} job pages...\n"
|
||||||
|
|
||||||
i = 0
|
for i, url_dict in enumerate(job_urls, start=1):
|
||||||
for url, region, keyword in job_urls:
|
url = url_dict.get("url")
|
||||||
i += 1
|
region = url_dict.get("region", "")
|
||||||
|
keyword = url_dict.get("keyword", "")
|
||||||
|
if not url:
|
||||||
|
continue
|
||||||
yield f"\n--- Processing job {i}/{len(job_urls)} ---\n"
|
yield f"\n--- Processing job {i}/{len(job_urls)} ---\n"
|
||||||
for message in process_job_url(job_url=url, region=region, keyword=keyword):
|
for message in process_job_url(job_url=url, region=region, keyword=keyword):
|
||||||
yield message
|
yield message
|
||||||
|
|||||||
Reference in New Issue
Block a user