# Notes from https://www.crummy.com/software/BeautifulSoup/bs4/doc/
# Notes from https://codeburst.io/web-scraping-101-with-python-beautiful-soup-bb617be1f486

from bs4 import BeautifulSoup
import requests
# Here, we're just importing both Beautiful Soup and the Requests library
page_link = 'https://weather.com/weather/tenday/l/New+York+NY+USNY0996:1:US'
# this is the url that we've already determined is safe and legal to scrape from.
page_response = requests.get(page_link, timeout=5)
# here, we fetch the content from the url, using the requests library
soup = BeautifulSoup(page_response.content, "html.parser")
#we use the html parser to parse the url content and store it in a variable.

# print(soup.prettify())

print(soup.title)

# print(soup.title.name)

# print(soup.title.string)

# print(soup.title.parent.name)

print(soup.get_text())

