May-21-2023, 11:27 AM
(This post was last modified: May-21-2023, 11:28 AM by liketocode.)
Hello
I have a problem with this site so i would like to know what im doing wrong. It works for another sites.
I'm practicing simple web scraping and would like to scrape a temperature here but im getting None as output, so cant use
text = s.getText()
print(text)
after, cause it will give an error 'NoneType' object has no attribute 'getText'
I have a problem with this site so i would like to know what im doing wrong. It works for another sites.
I'm practicing simple web scraping and would like to scrape a temperature here but im getting None as output, so cant use
text = s.getText()
print(text)
after, cause it will give an error 'NoneType' object has no attribute 'getText'
import requests from bs4 import BeautifulSoup r = requests.get('https://freemeteo.com.hr/vrijeme/zagreb/trenutno-vrijeme/mjesto/?gid=3186886&language=croatian&country=croatia') soup = BeautifulSoup(r.content, 'html.parser') s = soup.find('div', class_='temp metric') print(s)
Output:None