I am trying to scrape data from the American Kernel Club (https://www.akc.org/reg/dogreg_stats.cfm) and I have been having some trouble. I am referring to this stackoverflow post and I can get all of the rows on the second table but I cannot format them.
So here is my code.
from bs4 import BeautifulSoup
import requests
url = https://www.akc.org/reg/dogreg_stats.cfm
r. requests.get(r)
data= r.text
soup = BeautifulSoup(data)
rows = soup.find_all('table')[1].find_all('tr')
for row in rows:
cells = soup.find_all('td')
firstRanking = cell[1].get_text()
print(firstRanking)
All it prints out is
More on Registration Trends:
More on Registration Trends:
More on Registration Trends:
More on Registration Trends:
More on Registration Trends:
More on Registration Trends:
More on Registration Trends:
Instead of the actual rankings.