Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- job_titles_ = []
- informations_ = []
- companies_ = []
- # Scrolling
- last_height = driver.execute_script('return document.documentElement.scrollTop')
- while True:
- # Soup Object
- soup = BeautifulSoup(driver.page_source, 'lxml')
- dates = soup.findAll('div', class_ = 'card-date')
- for date in dates:
- try:
- dates_.append(date.text.split()[0])
- except:
- dates_.append('n/a')
- titles = soup.findAll('div', class_ = 'card-title')
- for title in titles:
- try:
- job_titles_.append(title.text.replace('star','').strip())
- except:
- job_titles_.append('n/a')
- informations = soup.findAll('div', class_ = 'card-info')
- for information in informations:
- try:
- informations_.append(information.text)
- except:
- informations_.append('n/a')
- companies = soup.findAll('div', class_ = 'secondary-text')
- for company in companies:
- try:
- companies_.append(company.text)
- except:
- companies_.append('n/a')
- driver.execute_script("window.scrollBy(0, 2000);")
- time.sleep(2)
- new_height = driver.execute_script('return document.documentElement.scrollTop;')
- if new_height == last_height:
- break
- last_height = new_height
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement