I want to show some datas of OpenWeather (city, weather weekly degree…etc). But when i code the day name as title, i face with a problem like at the photo i screenshot.(‘NoneType’ object has no attribute ‘findAll’)
from bs4 import BeautifulSoup
import requests
import pandas
try:
source = requests.get(‘https://openweathermap.org/’)
soup = BeautifulSoup(source.text,'html.parser')
weather_list = soup.find('ul',class_="day-list").findAll('li')
for weather in weather_list:
title = weather.find('span')
except Exception as e:
print(e)
I controlled the installs (pandas, request and bs4). I didn’t face with any problem. Then i focused HTML codes of websites but i am beginner at this field so i try my best. I think the problem at HTML codes. So can you explain the solution ?
Selenay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.