Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- # -*- coding: utf-8 -*-
- from re import compile
- from bs4 import BeautifulSoup
- from requests import get
- url = 'https://coinmarketcap.com/pt-br/currencies/coinracer/'
- headers = {'User-Agent': 'Mozilla/5.0 ()'}
- requesicao = get(url, headers).text
- # O soup é o padrão da lib
- soup = BeautifulSoup(requesicao, 'lxml')
- # primeira forma
- # filtro = soup.find_all(class_=compile('priceValue'))
- # Segunda forma
- filtro = soup.find_all('div', attrs={'class': 'priceValue'})
- for span in filtro:
- print(span.string)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement