Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
karankochhar123 committed Aug 19, 2019
1 parent ac477c7 commit 39e479a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions scraper.py
Expand Up @@ -22,6 +22,9 @@
while page <= total_pages:

print('reading data from URL page '+str(page))
source = requests.get(url).text
source_data=json.loads(source)

for data in source_data['data']:
jobID = data['id']
title = data['title']
Expand All @@ -39,12 +42,12 @@
subClassificationID = data['subClassification']['id']
worktype = data['workType']
#
print('Writing record '+str(jobID))
#print('Writing record '+str(jobID))
scraperwiki.sqlite.save(unique_keys=['jobID'], data={"jobID": jobID, "title": title,"AdvertiserID":advertiserID,"Advertiser":advertiser,"Area":area,"Classification":classification,"ClassificationID":classificationID,"Listing Date":listingDate,"Location":location,"LocationID":locationID,"LocationWhere":locationWhere,"Salary":salary,"Subclassification":subClassification,"Worktype":worktype})

page = page + 1
print(page)
#print(page)
url = 'https://api.seek.com.au/v2/jobs/search?keywords=data%20science%20&page='+str(page)+'&sortmode=ListedDate'
print(url)
#print(url)

print('Read all pages')

0 comments on commit 39e479a

Please sign in to comment.