# -*- coding: utf-8 -*-
import scrapy
import sys
sys.path.append("D:\\pycodes\\novel")
class XiaoshuoSpider(scrapy.Spider):
name = 'xiaoshuo'
start_urls = ['https://www.qu.la/paihangbang/']
novel_list=[]
def parse(self, response):
global i
i=0
for sel in response.xpath("//div[@ class='topbooks']"):
book_name=sel.xpath(".//a/text()").extract()
book_hrefs=sel.xpath(".//a/@href").extract()
for href in book_hrefs:
count=0
url = 'https://www.qu.
python 爬取排行榜小说和文本
最新推荐文章于 2024-06-24 18:45:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)