![]() |
#2
wp2319572019-07-10 09:49
|
网页源代码,其中红框内的文字是我要的内容
只有本站会员才能查看附件,请 登录
爬取网页的代码如下:
weburl="http://
req=urllib.request.Request(url=weburl)
response=urllib.request.urlopen(req)
content = response.read()
#获得系统的编码
type = sys.getfilesystemencoding()
#设置爬出内容的编码
content = content.decode(type)
求教各位大神,如何爬取我要的内容?如果可以,请写出完整的代码,不要只写正则表达式,小白一个,谢谢各位