im not sure what is wrong and why beautifulsoup cannot find the tr class. What am I doing wrong or where should I look?
import requests
from bs4 import BeautifulSoup
URL = "https://www.dailyfx.com/economic-calendar#yesterday"
page = requests.get(URL)
soup = BeautifulSoup(page.content, 'html.parser')
tbody = soup.find("tbody", class_ = "dfx-font-size-4")
column = tbody.find("tr", class_= "dfx-expandableTable__row dfx-
economicCalendarRow__pastEvent")
td = column.find("td", class_="dfx-economicCalendarRow__countryCol jsdfx-
economicCalendarRow__countryCol align-top")
div = td.find("div", class_="dfx-economicCalendarRow__countryContent dfx-
expandableTable__fadeableContent dfx-border--y-0 dfx-border--l-0 text-nowrap pe-lg-6
w-100")
country = div.find("span", class_="dfx-economicCalendarRow__country jsdfx-
economicCalendarRow__country align-middle text-black font-weight-bold d-none d-lg-
inline").text
print(country)
here is the error:
Traceback (most recent call last): File "c:\Users\Economic Event Scraper\test.py", line 12, in td = column.find("td", class_="dfx-economicCalendarRow__countryCol jsdfx-economicCalendarRow__countryCol align-top") AttributeError: 'NoneType' object has no attribute 'find'