Skip to content

Commit

Permalink
Code changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ram-95 authored Oct 22, 2021
1 parent 2ddfc58 commit 75ec1ed
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 35 deletions.
45 changes: 25 additions & 20 deletions Indeed_Job_Scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,60 @@
import requests
from bs4 import BeautifulSoup

headers = {"User-agent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"}
headers = {
"User-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36"}

#Skills and Place of Work
# Skills and Place of Work
skill = input('Enter your Skill: ').strip()
place = input('Enter the location: ').strip()
no_of_pages = int(input('Enter the #pages to scrape: '))


#Creating the Main Directory
# Creating the Main Directory
main_dir = os.getcwd() + '\\'
if not os.path.exists(main_dir):
os.mkdir(main_dir)
print('Base Directory Created Successfully.')


#Name of the CSV File
# Name of the CSV File
file_name = skill.title() + '_' + place.title() + '_Jobs.csv'
#Path of the CSV File
# Path of the CSV File
file_path = main_dir + file_name

#Writing to the CSV File
with open(file_path, mode = 'w') as file:
writer = csv.writer(file, delimiter = ',', lineterminator = '\n')
#Adding the Column Names to the CSV File
writer.writerow(['JOB_NAME', 'COMPANY', 'LOCATION', 'POSTED', 'APPLY_LINK'])
# Writing to the CSV File
with open(file_path, mode='w') as file:
writer = csv.writer(file, delimiter=',', lineterminator='\n')
# Adding the Column Names to the CSV File
writer.writerow(
['JOB_NAME', 'COMPANY', 'LOCATION', 'POSTED', 'APPLY_LINK'])

#Requesting and getting the webpage using requests
# Requesting and getting the webpage using requests
print(f'\nScraping in progress...\n')
for page in range(no_of_pages):
url = 'https://www.indeed.co.in/jobs?q=' + skill + '&l=' + place +'&start=' + str(page * 10)
response = requests.get(url, headers = headers)
url = 'https://www.indeed.co.in/jobs?q=' + skill + \
'&l=' + place + '&start=' + str(page * 10)
response = requests.get(url, headers=headers)
html = response.text

#Scrapping the Web
# Scrapping the Web
soup = BeautifulSoup(html, 'lxml')
base_url = "https://in.indeed.com"
base_url = "https://in.indeed.com/viewjob?jk="
d = soup.find('div', attrs={'id': 'mosaic-provider-jobcards'})

jobs = soup.find_all('a', class_='tapItem')

for job in jobs:
job_id = job['id'].split('_')[-1]
job_title = job.find('span', title=True).text.strip()
company = job.find('span', class_='companyName').text.strip()
location = job.find('div', class_='companyLocation').text.strip()
posted = job.find('span', class_='date').text.strip()
job_link = base_url + job["href"]
job_link = base_url + job_id
#print([job_title, company, location, posted, job_link])

#Writing to CSV File
writer.writerow([job_title, company, location.title(), posted, job_link])

print(f'Jobs data written to <{file_name}> successfully.')
# Writing to CSV File
writer.writerow(
[job_title, company, location.title(), posted, job_link])

print(f'Jobs data written to <{file_name}> successfully.')
30 changes: 15 additions & 15 deletions Python_India_Jobs.csv
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
JOB_NAME,COMPANY,LOCATION,POSTED,APPLY_LINK
"Associate, International Strategy and Operations",Indeed,"Hyderabad, Telangana",30+ days ago,https://in.indeed.com/pagead/clk?mo=r&ad=-6NYlbfkN0AJBO_rx4KHmXKNMEaxjtO12lnTQ6m01j_7o1fJ8IM0jnYIxKsacZpzZQPssPiik5io9Yfy5HhAheUHzg6brAJ1KkWTk3zUI7QsK133Kkch5qZQqNdog-8s2Z31H1-gcJzEUI9qExFLQirNXeUBEA9Lk-Hw38uttIUMqgxQPUFLlKR61rp7aI8batyqjPWgZyAQBZX69BKxOi0IK6IxJll13E53o7yni9X2-wv3mNfVKaquUVysTfdBwiZz4tWsKu8q3uoqKc2GnFy-9YMwDj3lvOvPRc5hYgZnk52H5uK_j1oRfXCh-S28ifyK9fra6-Vr01z0wqfYvKIgSsCv1ngRBj56YGs7L1s-LADfZb4Fui44ccXYYDxSyCLhT7cedN3cOyvUR3st5ME2YDkK-cTYJO_jpzLsx82nPVgcViIZ6edsvVpjhQWhPjyC4cgQ_o8=&p=0&fvj=0&vjs=3
"Python Developer (2- 4 years) ""Permanent WFH""",Maplelabs,"Bengaluru, Karnataka�Remote",25 days ago,https://in.indeed.com/pagead/clk?mo=r&ad=-6NYlbfkN0ALD04RKTFglTitvs6CEKIjQPPFgnE6uigjHUjV016zeMCht1aUrW-olGCV1v6lsJ150K0d2DgYivxKrsdsR82I5uSUVRFPx1kyYcaN2VZLVRucq2knCeybVZP6PHbj8tIciZKJLKi36eWtaru94x_PvVfH7B4wAR4QhqkZWeTvzuXixdqf_cd6xWlQNJQ_CnWcp3N5z-PJkGKHxgQ6opE5QgbYUhhL-O5-PIZkTIxUzItZrqoV2oCiYE-vuNHAh2C_IcOETTts0BHVwhIOJa0BCKFu7GnHc9-gDLEGdHyoHlavgelFTwhbigxNN_jneKk9cUAaSCvlSOzFumHK7XVVfkGNy5epsUfg4jXZr17HzWmi4BtTLBncIha5cY7I5hBbaJTGepd5mC41auGEJwNJhUAN0ljWfo5dffi4bH9njxnQg0TOqUE-3bdWZiTM0tLwUk-Xaumiiqh9Ks6Vh8nxHlWEv8I4NF27N9Tg1mr6E7GZB6LPkTWP&p=1&fvj=1&vjs=3
Software Engineer,Indeed,"Hyderabad, Telangana",30+ days ago,https://in.indeed.com/pagead/clk?mo=r&ad=-6NYlbfkN0DWhcgmADz_twSLwem2iYl2ct_LZF9UYK3pCI3i-FPPnqqtU4kkHUEqIz-u3u4oWG17E2P-q2X1k60bEAGzt_KuzfuRJLzKgmuwOjqBZC2OQs6uIHhUa4VkKCnTk0iCyal47wtIlQPfq_nXjF9n_yVrOzonKTtEj4DnVzj_qSdEgejJSfO8X8mKNvg05phHuMDqjmGtQ3o14ktmycXgPo348xpZiPtO_-MmliAnli2h-8RXuS1pf5tldIV2_EyHku7KEt4-ARfAYuB6Te6CaLTGMxGZ4onK9ykFRGLoPlLhBIQTdPJG3rTif6tKsROL_dNijDJlqn7j-4_00K5b6Fv5DQz6P4T7iXMnMSJwC7mqcUbWVzujai0NNfS4MX0BJaup64-u2EzQpjSrIfN_mPL9ibylOD5LlkFK2ZBE1V2OflDe52jp5Q6tHTcAzj-BvE81mFF7PqMfWoaFEp5QdsSg8dd_K7lbNbP2mYa2UDN6SMNdzEh_B6X8Sg2ux3EtRhjlKX2YZGIY79OXX4Xvr-k4&p=2&fvj=0&vjs=3
Software Engineer (Python),SEOReseller.com,"Mumbai, Maharashtra�Remote",13 days ago,https://in.indeed.com/pagead/clk?mo=r&ad=-6NYlbfkN0CfJah1Zq1yAH_1eti0eI3cJ7oaN-Xjdle7ysdbIUYcWry2oBk9bKPpY99c-l3G4vUAW0Ug0jtY-D8gAiCWcDro7Tco4a2DYqsooUyCuhx4a3n4nj5XJXq1mhM8P0ZdOsSrWOvWI5j2bh0UVGFtD1fay6CpKw5W49C_AGrT4CWGCMAbKzTi1X3cY2Nqe1JfhK7k0qxpAPIrkUTrbRoyfw1-pdOeFyRK_eZJ_Hlk-7eYWo8hehRnUO-oHo5GyOGxGNuVCLuCdWu3fAQgU9fYlJ9oN76q65EEOFaNsOFt_ty_jBczUaI3bQ0hA2Z4sW3k2KUp7YXvvXHqw9TrVE07sfqot9IySWdJHR0I40oDRzY-t_JpbFI2GmprDLQF2HdwVgrU_4hLSL9ZCMkrjUExwLJduB0-yL22kvINc9nQl-qXr5Hv_wwXNu3FHUbfRJxcjFZQpozmqdpf_L4LwiDQxTzyUT38dDffuzxdoUo-BWjhXQ==&p=3&fvj=1&vjs=3
Python Developer,www.yansisofsol.com,"Hyderabad, Telangana�Remote",9 days ago,https://in.indeed.com/company/www.yansisofsol.com/jobs/Python-Developer-745da72d7231c09e?fccid=199124e77fa54fa7&vjs=3
Hiring||Odoo/Python Freshers/Jr Resources||Sailotech Pvt Ltd...,Sailotech,"Hyderabad, Telangana",16 days ago,https://in.indeed.com/rc/clk?jk=cc63c58613685e02&fccid=676538bff8d017f5&vjs=3
Python Developer,DATADOT SOFTWARE SOLUTIONS,"Hyderabad, Telangana",3 days ago,https://in.indeed.com/company/DATADOT-SOFTWARE-SOLUTIONS/jobs/Python-Developer-cd1d59b699b1b826?fccid=a978363f4395c8ce&vjs=3
Python Developer (Application Development),Morgan Stanley,"Bengaluru, Karnataka",7 days ago,https://in.indeed.com/rc/clk?jk=6103a62d6c5321f3&fccid=0c39fb2c91742dcf&vjs=3
Python Developer,Talos Global,"Hyderabad, Telangana+2 Locations�Remote",10 days ago,https://in.indeed.com/company/Talos-Global/jobs/Python-Developer-73fb0a25aa65bdc9?fccid=afa08616b8f06182&vjs=3
Python Developer,Vouchpro Services Private Limited,"Hyderabad, Telangana",10 days ago,https://in.indeed.com/company/Vouchpro-Services-Private-Limited/jobs/Python-Developer-b5ce322b58ea0c64?fccid=9e4b64186df10fc5&vjs=3
Artificial Intelligence,RetrieveAI,"Hyderabad, Telangana�Remote",3 days ago,https://in.indeed.com/company/RetrieveAI/jobs/Artificial-Intelligence-eb7e07c66cbc4ce6?fccid=c1a70b93c23eac59&vjs=3
python resources,Globex Digital Solutions,"Hyderabad, Telangana",30+ days ago,https://in.indeed.com/rc/clk?jk=741d7923fdccafcb&fccid=787c9aafcfc53d14&vjs=3
Python Developer,Achala IT solutions,"Hyderabad, Telangana",10 days ago,https://in.indeed.com/company/Achala-IT-solutions/jobs/Python-Developer-4565887619e3b70b?fccid=1cbce5bb04c95a26&vjs=3
Python Developer,"Nimaisoft Systems Pvt Ltd.,","Visakhapatnam, Andhra Pradesh",26 days ago,https://in.indeed.com/rc/clk?jk=c4a4ceef595f3417&fccid=c36a0c55f187a6bd&vjs=3
Python Software Engineer,NCR,"Hyderabad, Telangana",4 days ago,https://in.indeed.com/rc/clk?jk=805e64da661e3448&fccid=50597ebf467edd46&vjs=3
"Associate, International Strategy and Operations",Indeed,"Hyderabad, Telangana",30+ days ago,https://in.indeed.com/viewjob?jk=6fada2a8d2fd745f
"Python Developer (2- 4 years) ""Permanent WFH""",Maplelabs,"Bengaluru, Karnataka�Remote",25 days ago,https://in.indeed.com/viewjob?jk=b019e0f447a23638
Software Engineer (Python),SEOReseller.com,"Mumbai, Maharashtra�Remote",13 days ago,https://in.indeed.com/viewjob?jk=dd2ebce3404c68c9
Software Engineer,Indeed,"Hyderabad, Telangana",30+ days ago,https://in.indeed.com/viewjob?jk=55c9294c62f01e1a
Business Systems Analyst - Python & SQL,NUKG Business Solutions,"Hyderabad, Telangana�Temporarily Remote",30+ days ago,https://in.indeed.com/viewjob?jk=9ed651a95a53e6d7
Python Developer,www.yansisofsol.com,"Hyderabad, Telangana�Remote",9 days ago,https://in.indeed.com/viewjob?jk=745da72d7231c09e
Python Developer (Application Development),Morgan Stanley,"Bengaluru, Karnataka",7 days ago,https://in.indeed.com/viewjob?jk=6103a62d6c5321f3
Hiring||Odoo/Python Freshers/Jr Resources||Sailotech Pvt Ltd...,Sailotech,"Hyderabad, Telangana",16 days ago,https://in.indeed.com/viewjob?jk=cc63c58613685e02
Python Developer,DATADOT SOFTWARE SOLUTIONS,"Hyderabad, Telangana",3 days ago,https://in.indeed.com/viewjob?jk=cd1d59b699b1b826
Python Developer,Vouchpro Services Private Limited,"Hyderabad, Telangana",10 days ago,https://in.indeed.com/viewjob?jk=b5ce322b58ea0c64
Artificial Intelligence,RetrieveAI,"Hyderabad, Telangana�Remote",3 days ago,https://in.indeed.com/viewjob?jk=eb7e07c66cbc4ce6
python resources,Globex Digital Solutions,"Hyderabad, Telangana",30+ days ago,https://in.indeed.com/viewjob?jk=741d7923fdccafcb
Python Developer,Talos Global,"Hyderabad, Telangana+2 Locations�Remote",10 days ago,https://in.indeed.com/viewjob?jk=73fb0a25aa65bdc9
Python Software Engineer,NCR,"Hyderabad, Telangana",4 days ago,https://in.indeed.com/viewjob?jk=805e64da661e3448
Python Developer,Achala IT solutions,"Hyderabad, Telangana",10 days ago,https://in.indeed.com/viewjob?jk=4565887619e3b70b

0 comments on commit 75ec1ed

Please sign in to comment.