This file contains hidden or 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
| const response = await axios('http://api.scraperapi.com?api_key={Your_API_Key}&url=https://datatables.net/examples/styling/display.html') |
This file contains hidden or 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
| soup = BeautifulSoup(response.content,'html.parser') |
This file contains hidden or 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
| job_title = soup.find('h3', class_='base-search-card__title').text | |
| print(job_title) |
This file contains hidden or 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 linkedin_scraper(webpage, page_number): | |
| next_page = webpage + str(page_number) | |
| print(str(next_page)) | |
| response = requests.get(str(next_page)) | |
| soup = BeautifulSoup(response.content,'html.parser') |
This file contains hidden or 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
| if page_number < 25: | |
| page_number = page_number + 25 | |
| linkedin_scraper(webpage, page_number) |
This file contains hidden or 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
| print(response) | |
| print(page_number) | |
| if page_number < 25: | |
| page_number = page_number + 25 | |
| linkedin_scraper(webpage, page_number) | |
| linkedin_scraper('https://www.linkedin.com/jobs-guest/jobs/api/seeMoreJobPostings/search?keywords=Product%20Management&location=San%20Francisco%20Bay%20Area&geoId=90000084&trk=public_jobs_jobs-search-bar_search-submit&position=1&pageNum=0&start=', 0) |
This file contains hidden or 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
| jobs = soup.find_all('div', class_='base-card relative w-full hover:no-underline focus:no-underline base-card--link base-search-card base-search-card--link job-search-card') |
This file contains hidden or 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
| for job in jobs: | |
| job_title = job.find('h3', class_='base-search-card__title').text.strip() | |
| job_company = job.find('h4', class_='base-search-card__subtitle').text.strip() | |
| job_location = job.find('span', class_='job-search-card__location').text.strip() | |
| job_link = job.find('a', class_='base-card__full-link')['href'] |
This file contains hidden or 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
| file = open('linkedin-jobs.csv', 'a') | |
| writer = csv.writer(file) | |
| writer.writerow(['Title', 'Company', 'Location', 'Apply']) |
This file contains hidden or 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
| writer.writerow([ | |
| job_title.encode('utf-8'), | |
| job_company.encode('utf-8'), | |
| job_location.encode('utf-8'), | |
| job_link.encode('utf-8') | |
| ]) |