In [130]:
import requests
from bs4 import BeautifulSoup

page = requests.get("https://weather.com/weather/tenday/l/BRXX0158:1:BR") #Natal
# https://weather.com/weather/tenday/l/BRXX2877:1:BR Parnamirim
soup = BeautifulSoup(page.content, 'html.parser')
# page.content
# print(page.content)
# print(soup.prettify())
# soup.find_all('p')

In [131]:
ten_days = soup.find_all("tr", class_="clickable")
ten_days.pop(0)
days_max = []
days_min = []
precips = []
humidity = []

for day in ten_days:
    days_max.append(int(day.find("td", class_="temp").find_all("span")[0].get_text().encode('ascii', 'ignore')))
    days_min.append(int(day.find("td", class_="temp").find_all("span")[2].get_text().encode('ascii', 'ignore')))
    precips.append(int(day.find("td", class_="precip").find_all("span")[2].get_text().encode('ascii', 'ignore')[:-1]))
    humidity.append(int(day.find("td", class_="humidity").find_all("span")[0].get_text().encode('ascii', 'ignore')[:-1]))
for i in range(14):
    print(str(((days_max[i]-32)/1.8))+"ºC " + str(((days_min[i]-32)/1.8))+"ºC "+str(precips[i])+"% "+str(humidity[i])+"%")


85ºF 74ºF 20% 72%
84ºF 74ºF 50% 74%
83ºF 73ºF 40% 75%
84ºF 73ºF 40% 74%
84ºF 73ºF 20% 74%
84ºF 73ºF 20% 74%
83ºF 73ºF 40% 74%
83ºF 73ºF 20% 74%
83ºF 73ºF 50% 77%
83ºF 73ºF 60% 77%
84ºF 73ºF 50% 76%
84ºF 73ºF 50% 76%
84ºF 73ºF 60% 75%
84ºF 73ºF 60% 75%

In [ ]: