troubleshooting Question

Python AttributeError: 'list' object has no attribute 'find_all'

Avatar of adbyits
adbyits asked on
Python
1 Comment1 Solution685 ViewsLast Modified:
Hi all i am new to the site i am trying to get a python script i am doing working and i am getting a error AttributeError: 'list' object has no attribute 'find_all'

I have attached the code , i would like to get all the different fulds in to different elements so i can save them to a mysql database

#erth Airpirt DEPARTURE IMPORT SCRIPT
#CREATED BY ADBY IT AND MEDIA SOLUTIONS
#VERSION 1.1
#DATE 25 NOVEMBER 2019
#UPDATED 26 NOVEMBER 2019
#AUTHOR ADAM R WOLARCZUK


from requests_html import HTMLSession # import HTMLSession from requests_html
import requests
from requests_html import HTMLSession
from bs4 import BeautifulSoup
import mysql.connector


session = HTMLSession() # create an HTML Session object
resp = session.get("https://www.adelaideairport.com.au/flight-information/flight-search/") # Use the object above to connect to needed webpage
resp.html.render() # Run JavaScript code on webpage


#page = requests.get("https://www.adelaideairport.com.au/flight-information/flight-search/")
soup = BeautifulSoup(resp.html.html, "lxml")
flights = resp.html.find("SearchResultFlightListTable")
flight_items = flights.find_all(class_="row")
flight = flight_items[0]
print(flight.prettify())
ASKER CERTIFIED SOLUTION
sahil Chopra

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros