python3实现抓取网页资源的 N 种方法

xghzgm35098 14 0 PDF 2020-12-30 14:12:31

这两天学习了python3实现抓取网页资源的方法,发现了很多种方法,所以,今天添加一点小笔记。 1、最简单 import urllib.request response = urllib.request.urlopen('http://python.org/') html = response.read() 2、使用 Request import urllib.request req = urllib.request.Request('http://python.org/') response = urllib.request.urlopen(req) the_page = respo

用户评论
请输入评论内容
评分:
暂无评论