I am trying to practice my python scraping for websites but am having trouble narrowing it down to a reasonable size without python not recognizing what I am asking for. For example, here is my code:
import bs4
import requests
url = requests.get('https://ballotpedia.org/Alabama_Supreme_Court')
soup = bs4.BeautifulSoup(url.text, 'html.parser')
y = soup.find('table')
print(y)
I am trying to scrape the names of the judges of the Alabama State Supreme Court, but with this code, I get far too much information. I have tried things such as (in row 6)
y = soup.find('table',{'class':'wikitable sortable'})`
but I get a message saying that the search finds no results.
Here is an image of the inspection of the webpage. I am aiming to get the thead to work in my code but am failing!
How can I specify to python that I want only the names of the judges?
Thank you very much!