Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
parsing table
#2
(Apr-25-2018, 08:16 PM)ian Wrote: AttributeError: ResultSet object has no attribute 'find'. You're probably treating a list of items like a single item. Did you call find_all() when you meant to call find()?

So even though there's only table, it's still a list of tables that just happens to have only one element. So you can either use .find() instead of find_all (like the error suggests), or you can iterate through the one-element list, like so:
for each_table in table:
    print(each_table.find("tbody"))
Reply


Messages In This Thread
parsing table - by ian - Apr-25-2018, 08:16 PM
RE: parsing table - by nilamo - Apr-25-2018, 08:21 PM
RE: parsing table - by ian - Apr-25-2018, 09:35 PM
RE: parsing table - by nilamo - Apr-26-2018, 02:57 AM
RE: parsing table - by ian - Apr-26-2018, 03:19 AM
RE: parsing table - by snippsat - Apr-26-2018, 05:19 AM
RE: parsing table - by ian - Apr-26-2018, 05:28 PM
RE: parsing table - by snippsat - Apr-26-2018, 08:05 PM
RE: parsing table - by nilamo - Apr-27-2018, 06:44 AM
RE: parsing table - by ian - Apr-27-2018, 12:16 PM
RE: parsing table - by snippsat - Apr-27-2018, 01:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help: Beautiful Soup - Parsing HTML table ironfelix717 2 2,703 Oct-01-2020, 02:19 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020