1
I need to scrape in Python a list on a website. Only the first list My code is 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’re scraping all the lists. I want to scratch the voting list of the description "Roll call vote, first round, PEC no 55/2016, amending the Act of Transitional Constitutional Provisions, to institute the New Tax Regime, and gives other provisions (Ceiling of Public Spending)."
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: https://www.crummy.com/software/BeautifulSoup/bs4/doc/
I believe this is it: lists = Soup.find_all('ul' , class_='unstyled', limit=2)
What data need to be extracted from this page?
– Miguel
The first voting list (Roll call vote, first round, PEC nº 55/2016), with the names of senators and how they voted. With the lists = Soup.find_all('ul' , class_='unstyled', limit=2) command I got it. I will now make commands to save this to a csv
– Reinaldo Chaves