作为一个小白,学习爬虫过程中,用python3写了这样一段代码
import requests
import re
content = requests.get('https://book.douban.com/').text
pattern = re.compile('<li.*?cover.*?bref="(.*?)",*?title="(.*?)".*?info.*?author">(.*?)<.*?year">(.*?)<',re.S)
results = re.findall(pattern,content)
for result in results:
url,title,name,date = result
print(url,title,name,date)
是豆瓣网,但是输出是这样的
F:\Python_code\venv\Scripts\python.exe F:/Python_code/Demotest.py
Process finished with exit code 0
就啥玩意都没输出呀,于是我尝试
print content
结果还是什么都输出不了,这个是怎么了?requests和re库已安装