为了账号安全,请及时绑定邮箱和手机立即绑定

"房星网 昆明”原代码标签(如<p>9391元/m²</p>)爬取时,“p标签内容”没了,为什么?

"房星网 昆明”原代码标签(如<p>9391元/m²</p>)爬取时,“p标签内容”没了,为什么?

慕莱坞5287464 2018-04-01 08:55:33
from urllib import request import re url = 'https://www.fangstar.com/ershoufang/panlongqu' root = '<div class="info"([\s\S]*?)</div>' unit_price = '<p>(\d*?元/m.\\b)</p>'  r = request.urlopen(url) htmls = r.read() htmls = str(htmls,encoding = 'utf-8') root_html = re.findall(root,htmls)#root:根 ershous = [] for html in root_html: unit_price = re.findall(unit_price,html) ershou = {'unit_price':unit_price} ershous.append(ershou) print(ershous)
查看完整描述

1 回答

?
慕函数9285021

TA贡献27条经验 获得超6个赞

动态生成的标签 ?

查看完整回答
反对 回复 2018-06-03
  • 1 回答
  • 1 关注
  • 1245 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信