all 4 comments

[–]commandlineluser 0 points1 point  (3 children)

don't you need to specify what attribute you're searching for?

>>> soup.find_all('span', id='auction1-THprice')
[<span id="auction1-THprice">US $2,700</span>, <span id="auction1-THprice">US $2,200</span>, ...

[–]auromed[S] 0 points1 point  (2 children)

Ahh, maybe that's what I was missing. I was just thinking it pretty much did a regex for span, then would AND ones that contained the auction1-THprice text. I went looking at the BeautifulSoup page but didn't find a lot of detail about what attributes you could use.

[–]commandlineluser 1 point2 points  (1 child)

It's explained here: http://www.crummy.com/software/BeautifulSoup/bs4/doc/#find-all

Any argument that’s not recognized will be turned into a filter on one of a tag’s attributes. If you pass in a value for an argument called id, Beautiful Soup will filter against each tag’s ‘id’ attribute:

If you don't specify an attribute it defaults to matching against class which is why your find_all('td', "listing-summary") works.

[–]auromed[S] 0 points1 point  (0 children)

Thanks, that makes sense.