Simple example BeautifulSoup Python -


i working simple example beautifulsoup, getting weird resutls.

here code:

soup = beautifulsoup(page) print soup.prettify() stuff = soup.findall('td', attrs={'class' : 'prodspecatribtue'}) print stuff 

when print get:

[] 

not sure what's happening, because when printed soup on screen got proper data. searching values in found in tag <td> under class prodspecatribtue

you misspelled class name:

soup.findall('td', attrs={'class': 'prodspecatribute'}) 

works fine. that's prodspecatribute, not prodspecatribtue. that's still misspelled, less so.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -