This commit is contained in:
ccppi 2024-07-18 13:48:44 +02:00
parent e3701c44ae
commit 315c1302cb
2 changed files with 11 additions and 11 deletions

View File

@ -79,9 +79,9 @@ def finder(results,item,**modes):
else: else:
result = entry.findAll(item.tag,class_=item.tag_content) result = entry.findAll(item.tag,class_=item.tag_content)
log("found count results:",len(result)) log("found count results:",len(result))
if len(result) == 0 and DEBUG == True: if not result and DEBUG == True:
for x in results: for x in results:
log(x) log("No entry found for: ",item.name,item.tag,item.tag_content," -->", x)
input() input()
if result: if result:
log("theres a result") log("theres a result")

View File

@ -46,19 +46,19 @@ def scrap_jobs(url,entry,session):
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_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) location = item("p",location_class,0,"location")
ar_location = finder(results,location,LOCATION_CLEANUP=1) ar_location = finder(results,location,LOCATION_CLEANUP=1)
company_class = "P-sc-hyu5hk-0 Text__p2-sc-1lu7urs-10 Span-sc-1ybanni-0 Text__span-sc-1lu7urs-12 Text-sc-1lu7urs-13 jZCxUn" company_class = "P-sc-hyu5hk-0 Text__p2-sc-1lu7urs-10 Span-sc-1ybanni-0 Text__span-sc-1lu7urs-12 Text-sc-1lu7urs-13 jZCxUn"
company = item("p",company_class,0) company = item("p",company_class,0,"company")
ar_company = finder(results,company,DEFAULT=1,GETCHILDREN='strong') ar_company = finder(results,company,DEFAULT=1,GETCHILDREN='strong')
title = item("span","jlFpCz",0,"TITLE!!") title = item("span","jlFpCz",0,"TITLE")
ar_title = finder(results,title,DEFAULT=1) 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) date = item("span","Span-sc-1ybanni-0 Text__span-sc-1lu7urs-12 Text-sc-1lu7urs-13 krGudM hUhFmL",0,"date")
ar_date = finder(results,date,CLEANDATE=1) ar_date = finder(results,date,CLEANDATE=1)
link = item("a",{'data-cy' :'job-link'},0) link = item("a",{'data-cy' :'job-link'},0,"link")
ar_link = finder(results,link,LINK=1,ATTRS=1,BASEURL="https://jobs.ch") ar_link = finder(results,link,LINK=1,ATTRS=1,BASEURL="https://jobs.ch")
tag = entry.tag#get from config tag = entry.tag#get from config
@ -138,16 +138,16 @@ def scrap_jobagent(url,entry,session):
print("no li items found") print("no li items found")
log("page:",page) log("page:",page)
title = item("span","jobtitle",0) title = item("span","jobtitle",0,"jobagent title")
ar_title = finder(results,title) ar_title = finder(results,title)
location = item("span","location",0) location = item("span","location",0,"jobagent location")
ar_location = finder(results,location,LOCATION_CLEANUP=1) ar_location = finder(results,location,LOCATION_CLEANUP=1)
company = item("span","company",0) company = item("span","company",0,"jobagent company")
ar_company = finder(results,company,DEFAULT=1) ar_company = finder(results,company,DEFAULT=1)
link = item("a","title",0) link = item("a","title",0,"jobagent link")
ar_link = finder(results,link,LINK=1) ar_link = finder(results,link,LINK=1)
date = item("span","pubdate",0) date = item("span","pubdate",0)