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

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
#输出源码

你可能感兴趣的:(爬虫工具)