jobs.ch changed, so changed scrap implementation

This commit is contained in:
ccppi 2024-08-12 12:56:05 +02:00
parent 45899d44e3
commit 5b78e29242
4 changed files with 29 additions and 15 deletions

View File

@ -1,8 +1,15 @@
[python_qt_indeed]
USER = NONE
PW = NONE
LOGINURL = NONE
SCRAPURL = https://ch.indeed.com/jobs?q=python+qt&
TAG = Informatiker, Python, qt
[quereinsteiger_indeed]
USER = NONE
PW = NONE
LOGINURL = NONE
SCRAPURL = https://ch.indeed.com/jobs?q=quereinsteiger+it&l=&from=searchOnDesktopSerp&vjk=7c069ecf7f0cabb6
SCRAPURL = https://ch.indeed.com/jobs?q=quereinsteiger+it
TAG = Informatiker, Quereinsteiger
[jobs.ch_seilbahn]

View File

@ -99,6 +99,11 @@ class MainWindow(QMainWindow):
self.view = QTableView()
self.view.setModel(self.model)
self.proxymodel2 = QSortFilterProxyModel(self)
self.proxymodel2.setSourceModel(self.model)
self.view.setModel(self.proxymodel2)
self.setProxyViewSettings()
self.delegate = ColorDelegate(self)
self.view.setItemDelegate(self.delegate)
@ -133,8 +138,8 @@ class MainWindow(QMainWindow):
self.view.setColumnWidth(5,10)
self.view.hideColumn(7)
self.view.setSortingEnabled(True)
self.sel_model = self.view.selectionModel()
self.sel_model.selectionChanged.connect(self.cell_clicked)
#self.sel_model = self.view.selectionModel()
#self.sel_model.selectionChanged.connect(self.cell_clicked)
def runWorker(self):
self.thread = QThread()
@ -255,10 +260,7 @@ class MainWindow(QMainWindow):
print("fetch iterations++")
self.model.fetchMore()
self.proxymodel2 = QSortFilterProxyModel(self)
self.proxymodel2.setSourceModel(self.model)
self.view.setModel(self.proxymodel2)
self.setProxyViewSettings()
self.view.show()
class PWPrompt(QDialog):
def __init__(self):

View File

@ -57,17 +57,18 @@ def scrap_jobs(url,entry,session):
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,"location")
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"
location_class = "d_grid items_start gap_s12 grid-cols_[auto_1fr] px_s8"
location = item("div",location_class,0,"location")
ar_location = finder(results,location,GETCHILDREN='p',LOCATION_CLEANUP=1)
company_class = "mb_s12 lastOfType:mb_s0 textStyle_p2"
company = item("p",company_class,0,"company")
ar_company = finder(results,company,DEFAULT=1,GETCHILDREN='strong')
title = item("span","jlFpCz",0,"TITLE")
title = item("span","text_link.brand.base",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,"date")
date = item("span","pos_absolute",0,"date")
ar_date = finder(results,date,CLEANDATE=1)
link = item("a",{'data-cy' :'job-link'},0,"link")

View File

@ -76,7 +76,8 @@ def login_loop(config_file,gui,worker):
ret_login = 0
session = 0
while (ret != 0):
worker.dialog_rejected = False
if gui:
worker.dialog_rejected = False
ret = entry2 = config.readConfig(config_file,gui,worker)
print(entry2)
if(ret != 0 and ret_login != 1):
@ -87,7 +88,10 @@ def login_loop(config_file,gui,worker):
log("worker.dialog_rejected = ",worker.dialog_rejected)
session = login(entry2)
ret_login = entry2.input_pw(gui,entry2.user,worker)
if worker.dialog_rejected == False:
if gui:
if worker.dialog_rejected == False:
choose_scraper(entry2,session)
if not gui:
choose_scraper(entry2,session)
def runner(entry,session,scrap_func,next_url_func):