我调试查看了一下抓取到的网页数据, 为什么我抓取到的网页数据不全
import re
from urllib import request
class Spider():
url = "https://movie.douban.com/tag/#/?sort=U&range=0,10&tags=%E7%94%B5%E5%BD%B1,%E5%96%9C%E5%89%A7"
urlpartten = 'article'# 用最简单的匹配 只能匹配到article级别
def __fetch_content(self):
r = request.urlopen(Spider.url)
self.htmls = r.read()
self.htmls = str(self.htmls, encoding='utf-8')
return self.htmls
def __analysis(self, html):
root_htmls = re.findall(Spider.urlpartten, html)
print(root_htmls)
def go(self):
html = self.__fetch_content()
self.__analysis(html)
spider = Spider()
spider.go()