Python抓取网页源码(核心编程)

对着背影说爱祢 提交于 2020-03-02 12:08:40

Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on

win32
Type “help”, “copyright”, “credits” or “license()” for more information.

import urllib2
#输入URL函数

response=urllib2.urlopen(‘htttp://www.baidu.com/’)

html=response.read()

print html
#输出源码

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!