Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- def extract(page):
- 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'}
- url = f'https://be.indeed.com/jobs?q=data+scientist&l=belgium&start={page}'
- r = requests.get(url,headers, verify= False)
- soup = BeautifulSoup(r.content, 'html.parser')
- return soup
- def transform(soup):
- divs = soup.find_all('div', class_ ='job_seen_beacon')
- for item in divs:
- title = item.find("span").text
- company = item.find('span', class_ ='companyName').text
- print(title)
- print(company)
- return
- c= extract(0)
- print(transform(c))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement