Skip to content

Commit 6f5b6a1

Browse files
authored
[fix] Fix bulldogsjob scrapper (#101)
* Fix regex for job objects detection * Fix bulldogjob test
1 parent 07dc289 commit 6f5b6a1

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

jobscrapper/scrappers/bulldogjob.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ def updateJobsDict(self, job_link_list):
3030
for job in job_link_list:
3131
try:
3232
#workarount for false job objects
33-
if not job.find('div', class_=re.compile("flex flex-col items-center relative my-auto", re.I)):
33+
if not job.find('div', class_=re.compile("JobListItem_item__title__Ae2Pm", re.I)):
3434
continue
3535

3636
job_link = job.get('href')
37-
job_title = job.find(name="h3", class_=re.compile("md:mb-5 lg:mb-0 md:text-18 text", re.I))
37+
job_title = job.find(name="h3", class_=re.compile("JobListItem_item__title__Ae2Pm", re.I))
3838
if job_title is not None:
3939
job_title = job_title.find(string=True, recursive=False).text
4040
else:

tests/test_bulldogjob.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_create_jobs_info_dict(_bulldogjob):
2121
for line in f:
2222
job_link_list += BeautifulSoup(line, 'html.parser')
2323
jobs_info_dict = _bulldogjob.updateJobsDict(job_link_list)
24-
assert len(jobs_info_dict) == 11
24+
assert len(jobs_info_dict) == 13
2525

2626
def test_create_jobs_info_dict_wrong_list(_bulldogjob):
2727
wrong_job_link_list = 5

0 commit comments

Comments
 (0)