Created
December 22, 2017 16:10
-
-
Save serenamm/fe6902610a629147a0aceeec341f1ddb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def scrapeGlassdoor(): | |
import helper | |
# Load existing dictionary | |
# Initialize if empty | |
try: | |
job_dict = load_obj("C:/Users/Serena/Desktop/Projects/Glassdoor/job_dict") | |
desc_dict = load_obj("C:/Users/Serena/Desktop/Projects/Glassdoor/desc_dict") | |
except: | |
job_dict = {} | |
desc_dict = {} | |
# Initialize website, city, jobs | |
job_lst = ["Data Analyst", "Data Scientist"] | |
city_lst = ["Toronto", "Vancouver"] | |
# Search for jobs | |
for job_name in job_lst: | |
for city in city_lst: | |
try: | |
update_jdict, update_ddict = search_jobs(job_name, city, job_dict, desc_dict, num_pages = 1) | |
job_dict.update(update_jdict) | |
desc_dict.update(update_ddict) | |
except Exception as e: | |
print(e) | |
save_obj(job_dict, "job_dict") | |
save_obj(desc_dict, "desc_dict") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment