-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
58 lines (35 loc) · 1.61 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from asyncore import write
from bs4 import BeautifulSoup
import requests
import time
print("Tell Us Your Skills : ")
unfamiliar_skill = input('> ')
print(f"Filtering Out {unfamiliar_skill}")
def find_jobs():
html_text = requests.get('https://www.timesjobs.com/candidate/job-search.html?searchType=personalizedSearch&from=submit&txtKeywords=python&txtLocation=').text
soup = BeautifulSoup(html_text, 'lxml')
jobs = soup.find_all('li',class_='clearfix job-bx wht-shd-bx')
for index, job in enumerate(jobs):
job_published_date = job.find('span',class_ = 'sim-posted').span.text
if('few' in job_published_date):
company_name = job.find('h3', class_ = 'joblist-comp-name').text.replace(' ','')
skills = job.find('span', class_ = 'srp-skills').text.replace(' ','')
more_info = job.header.h2.a['href']
if(unfamiliar_skill not in skills):
with open(f'posts/{index}.txt','w') as f:
f.write(f"Company Name : {company_name.strip()}")
f.write('\n')
f.write(f"Skills Required : {skills.strip()} ")
f.write('\n')
f.write(f"Job Info : {more_info}")
f.write('\n')
f.write(f"Date Published : {job_published_date.strip()}")
f.write('\n')
print(f'File Saved : {index}')
if __name__=='__main__':
while True:
find_jobs()
time_wait = 10
print(f"Waiting {time_wait} minutes ...")
time.sleep(time_wait*60)
print()