用30行代码爬取某小说网站上的一篇小说
一、导入模块
import requests
from lxml import etree
import time
二、获取网站的响应信息,并以text打印
url = 'https://www.biquge365.net/newbook/33411/'
head = {
'Referer': 'https://www.biquge365.net/book/33411/',
'users-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.1722.39'
}
response = requests.get(url,headers = head,verify