-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (28 loc) · 1.17 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
from bs4 import BeautifulSoup
import requests
import time
print('Put some skills that you are not familiar with')
unfamiliar_skill=input('>')
print(f'Filterning out {unfamiliar_skill}')
def find_jobs():
html_text=requests.get('https://www.timesjobs.com/candidate/job-search.html?searchType=personalizedSearch&from=submit&txtKeywords=solidity+&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):
published_date=job.find('span', class_='sim-posted').span.text
if 'few' in 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()}\n")
f.write(f"Required Skills: {skills.strip()}\n")
f.write(f'More Info: {more_info}\n')
print(f'File saved: {index}')
if __name__ == '__name__':
while True:
find_jobs()
time_wait=10
print(f'Waiting {time_wait} minutes...')
time.sleep(time_wait*10)