I need to scrape into Python a list on a website. Only the first list My code looks like this:
import requests
from bs4 import BeautifulSoup
page = requests.get("http://www25.senado.leg.br/web/atividade/materias/-/materia/votacao/2363507")
soup = BeautifulSoup(page.content, 'html.parser')
lista = soup.find_all('ul' , class_='unstyled')
You are scraping all lists. I want to shave the voting list of the description "Nominal vote, in the first round, of PEC nº 55/2016, which amends the Act of Transitional Constitutional Provisions, to establish the New Tax Regime, and gives other measures (Ceiling of Public Expenses). "
But all lists have tag ul and class unstyled Does anyone know how to differentiate the lists?
I searched a little later, I read this site: link
I think this is it: lists = soup.find_all ('ul', class _ = 'unstyled', limit = 2)