Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
.findAll()
#6
(Nov-14-2018, 11:05 PM)Gribouillis Wrote: You can perhaps try .findall(**{'id': 'foo', 'class': 'bar'})

Again, I get []

Error:
Traceback (most recent call last): File "C:\Python36\kodovi\wbp.py", line 33, in <module> print(red_text.text) File "C:\Python36\lib\site-packages\bs4\element.py", line 1807, in __getattr__ "ResultSet object has no attribute '%s'. You're probably treating a list of items like a single item. Did you call find_all() when you meant to call find()? " % key AttributeError: ResultSet object has no attribute 'text'. You're probably treati ng a list of items like a single item. Did you call find_all() when you meant to call find()?
snippsat, I get this when I try to use findAll.

Also, your code does a different thing. It doesn't pick up word from id attribute.
Reply


Messages In This Thread
.findAll() - by Truman - Nov-14-2018, 10:42 PM
RE: .findAll() - by Gribouillis - Nov-14-2018, 10:49 PM
RE: .findAll() - by Truman - Nov-14-2018, 10:52 PM
RE: .findAll() - by Gribouillis - Nov-14-2018, 11:05 PM
RE: .findAll() - by Truman - Nov-16-2018, 12:21 AM
RE: .findAll() - by snippsat - Nov-14-2018, 11:37 PM
RE: .findAll() - by snippsat - Nov-16-2018, 12:51 PM
RE: .findAll() - by Truman - Nov-17-2018, 12:08 AM
RE: .findAll() - by snippsat - Nov-17-2018, 01:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  re.findall help searching for string in xml response mugster 2 3,279 May-30-2018, 03:27 PM
Last Post: mugster
  Different Output of findall and search in re module shiva 1 2,348 Mar-12-2018, 08:39 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