1. 目标网站:89文学网(https://www.89wxw.com)
2. python环境:IDLE
#基本思路:采用requests库和BeautifulSoup库爬取龙王传说小说
import requests
from bs4 import BeautifulSoup
def get_novel_chapters():#获得标签名称及链接
data_1 = []
root_url = 'https://www.89wxw.com/read/3440/'
headers = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'
}#用headers对pyt