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

Popular posts from this blog

javascript - Unusual behaviour when drawing lots of images onto a large canvas -

how can i manage url using .htaccess in php? -

javascript - Chart.js - setting tooltip z-index -