I would like to parse the HD price from the following snipper of HTML. I am only have fragments of the html code, so I cannot use an HTML parser for this.
You can still parse using BeautifulSoup, you don't need the full html:
BeautifulSoup
from bs4 import BeautifulSoup html=""" View In iTunes £19.99 HD Version """ soup = BeautifulSoup(html) sp = soup.find(attrs={"class":"price"}) print sp.text[1:] 19.99 0 讨论(0) 查看其它5个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复