Python Forum
Python assisstance for a beginner please
Thread Rating:
  • 4 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python assisstance for a beginner please
#7
An example with BeautifulSoup that @buran mention.
from bs4 import BeautifulSoup
import requests

url = 'https://forecast.weather.gov/MapClick.php?lat=32.47318000000007&lon=-100.40478999999999#.XC2EbM1MFEa/'
url_get = requests.get(url)
soup = BeautifulSoup(url_get.content, 'lxml')
weather = soup.find('div', id="current_conditions_detail")
for weathet_data in weather.find_all('tr'):
    print(weathet_data.text.strip())
Output:
Humidity 94% Wind Speed S 18 G 24 mph Barometer 29.88 in Dewpoint 54°F (12°C) Visibility 10.00 mi Wind Chill50°F (10°C) Last update 11 Jan 2:35 pm CST
Rick Wrote:I am now trying to turn everything into python but I am still in the learning phase.
You can look at this.
Web-Scraping part-1
Web-scraping part-2
Reply


Messages In This Thread
Python assisstance for a beginner please - by Rick - Jan-11-2019, 05:42 PM
RE: Python assisstance for a beginner please - by snippsat - Jan-11-2019, 09:14 PM

Forum Jump:

User Panel Messages

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