Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import bs4
- p = requests.get('https://vicesetversa.com')
- soup = bs4.BeautifulSoup(p.text, 'lxml')
- beers = soup.find_all('a', attrs={'class', 'biere-desc'})
- for b in beers:
- nom = b.find('div', attrs={'class': 'futs-titre'}).text
- if nom == '-':
- continue
- nom = nom.lstrip('* ')
- desc = b.find('div', attrs={'class': 'futs-desc'}).text
- desc = desc.split('|')
- type_ = desc[0].strip()
- alcool = desc[1].strip()
- brasserie = desc[2].strip()
- print('"{}" - "{}" - "{}"'.format(nom, type_, alcool, brasserie))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement