Skip to content

Commit 066a373

Browse files
authored
Web Scrapping
1 parent ab036d8 commit 066a373

File tree

5 files changed

+41
-0
lines changed

5 files changed

+41
-0
lines changed

WebScraping/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# WebScraping-Local-Website

WebScraping/posts/0.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Company Name: Python Developer Trainees at Smart Data Analytical
2+
Required Skills: About You
3+
Must Have:
4+
Good understanding of Python Demonstration of a python project will be required during the interview
5+
SQL, MySQL, Postgresql
6+
Web Experience UI and API development
7+
Un
8+
More Info: /job/python-developer-trainees-smart-data-analytical

WebScraping/posts/1.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Company Name: Senior Python / Django Back - end Engineer at R4Kenya
2+
Required Skills: The Position
3+
Our client is a fast growing, technology venture based in Nairobi, Kenya seeking to hire� �hands-on Senior Python/Django Back-end Engineer to join our Product team based in N
4+
More Info: /job/senior-python-django-back-end-engineer-r4kenya

WebScraping/posts/Capture.PNG

15.1 KB
Loading

WebScraping/scrap.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from bs4 import BeautifulSoup
2+
import requests
3+
import time
4+
5+
print('Please Enter Skills You are not familiar with')
6+
unfamiliar_skill = input(' > ')
7+
print(f'Filtering Out {unfamiliar_skill}')
8+
9+
def find_jobs():
10+
html_text = requests.get(' https://www.myjobmag.co.ke/search/jobs?q=python ').text
11+
soup = BeautifulSoup( html_text, 'lxml' )
12+
jobs = soup.find_all('li', class_ = 'job-list-li')
13+
for index, job in enumerate(jobs):
14+
published_date = job.find('li', class_ = 'job-item')
15+
company_name = job.find('h2').text.replace(' ', ' ')
16+
skills = job.find('li', class_ = 'job-desc').text.replace(' ', ' ')
17+
more_info = job.h2.a['href']
18+
if unfamiliar_skill not in skills:
19+
with open(f'posts/{index}.txt', 'w') as f:
20+
f.write(f"Company Name: {company_name.strip()} \n")
21+
f.write(f"Required Skills: {skills.strip()} \n")
22+
f.write(f"More Info: {more_info} \n")
23+
print('File Save Succesfully: {index}')
24+
25+
if __name__ == "__main__":
26+
while True:
27+
find_jobs()
28+
time.sleep(600)

0 commit comments

Comments
 (0)