Advertisement
g96

Untitled

g96
Apr 3rd, 2022
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1.  
  2. import requests
  3. from bs4 import BeautifulSoup
  4.  
  5. def extract(page):
  6.     headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36'}
  7.     url = f'https://be.indeed.com/jobs?q=data%20scientist&l=belgium&start={page}&vjk=66fcf0e037064cf5'
  8.     r = requests.get(url,headers, verify= False)
  9.     soup = BeautifulSoup(r.content, 'html.parser')
  10.     return soup
  11.  
  12.  
  13.  
  14. def transform(soup):
  15.     divs = soup.find_all('div', class_ ='job_seen_beacon')
  16.     for item in divs:
  17.         title = item.find("a").text
  18.         print(title)
  19.  
  20.  
  21. c= extract(0)
  22.  
  23. print(transform(c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement