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'
![[Image: forum.png]](https://i.ibb.co/fM7zK22/forum.png)
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'
![[Image: forum.png]](https://i.ibb.co/fM7zK22/forum.png)
1 2 3 4 5 6 7 8 9 10 |
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