<gh_stars>0
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="seven-day-forecast")
#forecast_items = seven_day.find_all(class_="tombstone-container")
#tonight = forecast_items[0]
period = seven_day.select(".tombstone-container .period-name")
periods=[ pt.get_text() for pt in period]
# short_desc = tonight.find(class_="short-desc").get_text()
#detail=tonight.find('img')
#desc=detail['title']
short_descs = [sd.get_text() for sd in seven_day.select(".tombstone-container .short-desc")]
temps = [t.get_text() for t in seven_day.select(".tombstone-container .temp")]
descs = [d["title"] for d in seven_day.select(".tombstone-container img")]
import pandas as pd
weather = pd.DataFrame({
    "period": periods, 
    "short_desc": short_descs, 
    "temp": temps, 
    "desc":descs
    })
print(weather)

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="seven-day-forecast")
#forecast_items = seven_day.find_all(class_="tombstone-container")
#tonight = forecast_items[0]
period = seven_day.select(".tombstone-container .period-name")
periods=[ pt.get_text() for pt in period]
# short_desc = tonight.find(class_="short-desc").get_text()
#detail=tonight.find('img')
#desc=detail['title']
short_descs = [sd.get_text() for sd in seven_day.select(".tombstone-container .short-desc")]
temps = [t.get_text() for t in seven_day.select(".tombstone-container .temp")]
descs = [d["title"] for d in seven_day.select(".tombstone-container img")]
import pandas as pd
weather = pd.DataFrame({
    "period": periods, 
    "short_desc": short_descs, 
    "temp": temps, 
    "desc":descs
    })
print(weather)
#forecast_items = seven_day.find_all(class_="tombstone-container") #tonight = forecast_items[0] # short_desc = tonight.find(class_="short-desc").get_text() #detail=tonight.find('img') #desc=detail['title']