Python re字符串匹配求助

ablackdog 2016-01-11 03:28:33
#coding=utf-8

import requests
import re

html = requests.get('http://tieba.baidu.com/f?ie=utf-8&kw=python&fr=search')
# html = requests.get('http://jp.tingroom.com/yuedu/yd300p/')
# html.encoding = 'utf-8'
# print html.text

lastreponder = re.findall('最后回复人:(.*?)">',html.text,re.S)
for each in lastreponder:
print each

代码如上
网页部分源代码如下:title="最后回复人:黄哥python培训">
即:
'最后回复人:(.*?)">'与"最后回复人:黄哥python培训">匹配不起来,
试过加\在"前,也是不行,求助下,谢谢!
...全文
944 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

2,204

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 CGI
社区管理员
  • CGI社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧