Advertisement
g96

Untitled

g96
Apr 2nd, 2022
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 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_ll('div', class_ ='mosaic-zone')
  16.     return len(divs)
  17.  
  18. c= extract(0)
  19.  
  20. print(transform(c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement