I am looking at this web site.
https://coronavirus.jhu.edu/map.html
It seems like the class is either 'flex-fluid list-item-content overflow-hidden ' (with presumably a space at the end) or 'external-html'
import requests
import pandas as pd
from bs4 import BeautifulSoup
r = requests.get("https://coronavirus.jhu.edu/map.html")
soup = BeautifulSoup(r.content)
mydivs = soup.findAll("a", {"class": "external-html"})
print(mydivs)
df = pd.DataFrame(mydivs)
df
mydivs = soup.find_all("div", {"class": "flex-fluid list-item-content overflow-hidden "})
print(mydivs)
df = pd.DataFrame(mydivs)
df
When I run the sample code below, I get nothing returned to 'mydivs'. I just get a blank bs4.element.ResultSet. I also checked for tables on this site, and I found none, so I'm thinking all the numbers under 'Cases by Country/Region/Sovereignty' must be contained in div classes. Basically, I'd like to get all the numbers organized nicely, in a data frame. What am I doing wrong?
I'm also using this link as a reference.
https://www.codegrepper.com/code-examples/python/beautifulsoup+find+all+div+class