- change search classes

- change some to attributes
- implement better debuging solution in finder()
This commit is contained in:
2024-07-18 11:26:13 +02:00
parent 2794dc8ed3
commit 4ede40c37c
3 changed files with 26 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
from helpers import *
DEBUG = False
DEBUG = True
def log(*s):
if DEBUG:
@@ -43,7 +43,7 @@ def scrap_jobs(url,entry,session):
soup = BeautifulSoup(page.content,"html.parser")
#print(soup.prettify())
results = soup.find_all("div",attrs={"data-feat":"searched_jobs"})
results = soup.find_all("div",attrs={'data-feat':'searched_jobs'})
location_class = "P-sc-hyu5hk-0 Text__p2-sc-1lu7urs-10 Span-sc-1ybanni-0 Text__span-sc-1lu7urs-12 Text-sc-1lu7urs-13 jZCxUn"
location = item("p",location_class,0)
@@ -53,14 +53,14 @@ def scrap_jobs(url,entry,session):
company = item("p",company_class,3)
ar_company = finder(results,company,DEFAULT=1)
title = item("span","Span-sc-1ybanni-0 Text__span-sc-1lu7urs-12 Text-sc-1lu7urs-13 VacancyItem___StyledText2-sc-iugtv6-5 iaJYDR jlFpCz dMwMcR",0)
title = item("span","jlFpCz",0,"TITLE!!")
ar_title = finder(results,title,DEFAULT=1)
date = item("span","Span-sc-1ybanni-0 Text__span-sc-1lu7urs-12 Text-sc-1lu7urs-13 krGudM hUhFmL",0)
ar_date = finder(results,date,CLEANDATE=1)
link = item("a","VacancyLink___StyledLink-sc-ufp08j-0",0)
ar_link = finder(results,link,LINK=1,BASEURL="https://jobs.ch")
link = item("a",{'data-cy' :'job-link'},0)
ar_link = finder(results,link,LINK=1,ATTRS=1,BASEURL="https://jobs.ch")
tag = entry.tag#get from config
return arrayToClass(ar_title,ar_company,ar_location,ar_date,ar_link,tag)