Python Forum
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Web Scraping help
#1
    import requests
    from bs4 import BeautifulSoup
 
    url = 'http://thefuckingweather.com/Where/10468'
    url_get = requests.get(url)
    soup = BeautifulSoup(html, 'html.parser')
    print(soup.select('temperature jsMainTemp').text.strip())
I'm trying to get the temperature data from any weather website. I can't seem to get it working due to a error saying AttributeError: 'list' object has no attribute 'text'
Reply
#2
What is that url???
Reply
#3
Where the 'html' in soup = BeautifulSoup(html, 'html.parser') comes from?
The page source is in the 'url_get' object. You can get it with url_get.content
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#4
There doesnt seem to be any way to get any info from that site, at least for me. When i input a zip code, it just reroutes me back to /NoWhere even if i link your url.
Recommended Tutorials:
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020