I'm trying to extract an element from this site. More specifically, I am trying to extract the temperature.
This is the following element I am attempting to extract using BeautifulSoup4:
<p class="temperature">-1<span>°C</span></p>
The following is my python code that is supposed to extract the element from the mentioned site:
import requests
from bs4 import BeautifulSoup
url = requests.get('https://www.theweathernetwork.com/ca/weather/ontario/mississauga')
soup = BeautifulSoup(url.content, 'lxml')
print(soup.find_all('p', {'class':'temperature'}))
And it just returns an empty array.
[]
I would be really appreciative if anyone could help me with this.
Note: I am new to python