module - Search an id in python with BeautifulSoup -
i need problem... doing code know content of tag but... can take content if have got id?
from bs4 import beautifulsoup import urllib2 code = '<span class="vi-is1-prcp" id="v4-27"> 15,00 eur </span>' soup = beautifulsoup(code) price = soup.find('a', id='v4-27') # <-- problem print price
if html code should replace 'a'
tag 'span'
tag. should this...
... price = soup.find('span',id="v4-27") print price #optional price.string give 15,00 eur #instead of entire html line
Comments
Post a Comment