I am attempting to web-scrape from a table on an open site using Python. I have checked to ensure that it will connect to the site using the command "page_soup.p" and got a return of the item with a 'p' tag.
When I check to ensure my scraping tag works with the command containers[0]
I am met with:
Traceback (most recent call last)
File "", line 1, in
IndexError: list index out of range"
from urllib.request import urlopen as uReq
from bs4 import BeautifulSoup as soup
my_url = 'https://overwatchleague.com/en-us/stats'
# opening up connect, grabbing the page
uClient = uReq(my_url)
page_html = uClient.read()
uClient.close()
# html parsing
page_soup = soup(page_html, "html.parser")
# grabs each player
containers = page_soup.findAll("tr",{"class":"Table-row"})
There should be roughly 183 rows with that tag, obviously 0 is not what I was expecting. Any insight into what I did improperly?