(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.