import requests
from bs4 import BeautifulSoup
r = requests.get('https://ca.finance.yahoo.com/quote/AMZN/profile?p=AMZN')
soup = BeautifulSoup(r.content, 'html.parser')
price = soup.find_all('div', {'class':'My(6px) Pos(r) smartphone_Mt(6px)'})
print(price)
So I am new to learning BeautifulSoup but I am slightly confused as to why this returns:
[]
Have I made an error in my code or does BeautifulSoup not pick up the website's code? Also whenever I try something like 'xml' or 'lxml' instead of the 'html.parser' it gives me an error as such:
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?