def getBlockJobsAndApply(): us = User('f') if os.path.isfile(us.personal['LogPathJobsInGeneva']): reflst = DL.getReferencesFromLog(us.personal['LogPathJobsInGeneva']) else: reflst = set() #here, unlike in pagepersonnel, the mainurl #contains already every job browser = BO.openNewBrowser(MAINURL) #we are now in page 1 of the results #for each page I wish to apply to every job applyToAllUrls(browser, reflst, us) while BO.isElementPresent(browser,'Next', 'link'): element = browser.find_element_by_link_text('Next') url = element.get_attribute('href') browser.get(url) applyToAllUrls(browser, reflst, us) time.sleep(2) time.sleep(5)
def getBlockJobsAndApply(): us = User('f') if os.path.isfile(us.personal['LogPathPagePersonnel']): reflst = DL.getReferencesFromLog(us.personal['LogPathPagePersonnel']) else: reflst = set() browser = BO.openNewBrowser(MAINURL) getBlockJobs(browser, 'Technology') toggleFilters(browser) selectLanguage(browser) #we are now in page 1 of the results #for each page I wish to apply to every job applyToAllUrls(browser, reflst, us) while BO.isElementPresent(browser, 'show-more-pager'): element = browser.find_element_by_class_name('show-more-pager') element = element.find_element_by_tag_name('a') url = element.get_attribute('href') browser.get(url) applyToAllUrls(browser, reflst, us) time.sleep(2) time.sleep(5)
def getBlockJobsAndApply(): us = User('f') if os.path.isfile(us.personal['LogPathExperis']): reflst = DL.getReferencesFromLog(us.personal['LogPathExperis']) else: reflst = set() browser = BO.openNewBrowser(MAINURL) #we are now in page 1 of the results #for each page I wish to apply to every job applyToAllUrls(browser, reflst, us) BO.waitForElementLocated(browser, 'pagingHeader_lnkNextPageItem', how='id', delay=30) #BUG : TODO while BO.isElementPresent(browser, 'pagingHeader_lnkNextPageItem', how='id'): browser.execute_script( "document.getElementById('pagingHeader_lnkNextPageItem').click();") applyToAllUrls(browser, reflst, us) time.sleep(2) time.sleep(10)