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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -