Skip to content
Snippets Groups Projects
Commit 0b9ebf8f authored by aslesha's avatar aslesha
Browse files

Upload New File

parent f4718b9e
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
import requests
from bs4 import BeautifulSoup
page = requests.get("http://forecast.weather.gov/MapClick.php?lat=37.7772&lon=-122.4168")
soup = BeautifulSoup(page.content, 'html.parser')
seven_day = soup.find(id="detailed-forecast-body")
forecast_items = seven_day.find_all(class_="row row-odd row-forecast")
forecast_items2 = seven_day.find_all(class_="row row-even row-forecast")
tonight = forecast_items[0]
tonight2 = forecast_items2[0]
x=list(tonight.children)[0]
print(x)
print(list(x.children)[0].get_text())
print("---------------------------------------------------------")
print(tonight.prettify())
print(tonight2.prettify())
```
%% Cell type:code id: tags:
``` python
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment