# -*- coding: utf-8 -*-
import scrapy

from novel.items import NovelItem


class SolveSpider(scrapy.Spider):
    name = "solve"
    allowed_domains = ["qidian.com"]
    start_urls = [];
    for x in range(1,5):#只有5页
        start_urls.append("https://www.qidian.com/all?orderId=&style=1&pageSize=20&siteid=1&pubflag=0&hiddenField=0&page=" + str(x))
    #start_urls = ["https://www.qidian.com/all?orderId=&style=1&pageSize=20&siteid=1&pubflag=0&hiddenField=0&page="]
   # page_index = ["1", "2", "3", "4", "5", "6", "7","8", "9", "10"]
    def parse(self, response):
        nolves = response.xpath('//ul[@class="all-img-list cf"]/li')
        for each in nolves:
           # print("***************************")

            item = NovelItem()
            part = each.xpath('./div[@class="book-mid-info"]')
            #print(part)
            item['bookname'] = part.xpath('./h4/a/text()').extract()
            item['link'] = part.xpath('./h4/a/@href').extract()[0]
            item['author'] = part.xpath('./p[@class="author"]/a[@class="name"]/text()').extract()
            item['category'] = part.xpath('./p[@class="author"]/a/text()').extract()
            item['content'] = part.xpath('./p[@class="intro"]/text()').extract()
            yield item

3e4b7509f8dab22bf954104de54b88bbf6ee2e36
<mask token>


class SolveSpider(scrapy.Spider):
    <mask token>
    <mask token>
    <mask token>
    for x in range(1, 5):
        start_urls.append(
            'https://www.qidian.com/all?orderId=&style=1&pageSize=20&siteid=1&pubflag=0&hiddenField=0&page='
             + str(x))
    <mask token>

<mask token>


class SolveSpider(scrapy.Spider):
    <mask token>
    <mask token>
    <mask token>
    for x in range(1, 5):
        start_urls.append(
            'https://www.qidian.com/all?orderId=&style=1&pageSize=20&siteid=1&pubflag=0&hiddenField=0&page='
             + str(x))

    def parse(self, response):
        nolves = response.xpath('//ul[@class="all-img-list cf"]/li')
        for each in nolves:
            item = NovelItem()
            part = each.xpath('./div[@class="book-mid-info"]')
            item['bookname'] = part.xpath('./h4/a/text()').extract()
            item['link'] = part.xpath('./h4/a/@href').extract()[0]
            item['author'] = part.xpath(
                './p[@class="author"]/a[@class="name"]/text()').extract()
            item['category'] = part.xpath('./p[@class="author"]/a/text()'
                ).extract()
            item['content'] = part.xpath('./p[@class="intro"]/text()').extract(
                )
            yield item

<mask token>


class SolveSpider(scrapy.Spider):
    name = 'solve'
    allowed_domains = ['qidian.com']
    start_urls = []
    for x in range(1, 5):
        start_urls.append(
            'https://www.qidian.com/all?orderId=&style=1&pageSize=20&siteid=1&pubflag=0&hiddenField=0&page='
             + str(x))

    def parse(self, response):
        nolves = response.xpath('//ul[@class="all-img-list cf"]/li')
        for each in nolves:
            item = NovelItem()
            part = each.xpath('./div[@class="book-mid-info"]')
            item['bookname'] = part.xpath('./h4/a/text()').extract()
            item['link'] = part.xpath('./h4/a/@href').extract()[0]
            item['author'] = part.xpath(
                './p[@class="author"]/a[@class="name"]/text()').extract()
            item['category'] = part.xpath('./p[@class="author"]/a/text()'
                ).extract()
            item['content'] = part.xpath('./p[@class="intro"]/text()').extract(
                )
            yield item

import scrapy
from novel.items import NovelItem


class SolveSpider(scrapy.Spider):
    name = 'solve'
    allowed_domains = ['qidian.com']
    start_urls = []
    for x in range(1, 5):
        start_urls.append(
            'https://www.qidian.com/all?orderId=&style=1&pageSize=20&siteid=1&pubflag=0&hiddenField=0&page='
             + str(x))

    def parse(self, response):
        nolves = response.xpath('//ul[@class="all-img-list cf"]/li')
        for each in nolves:
            item = NovelItem()
            part = each.xpath('./div[@class="book-mid-info"]')
            item['bookname'] = part.xpath('./h4/a/text()').extract()
            item['link'] = part.xpath('./h4/a/@href').extract()[0]
            item['author'] = part.xpath(
                './p[@class="author"]/a[@class="name"]/text()').extract()
            item['category'] = part.xpath('./p[@class="author"]/a/text()'
                ).extract()
            item['content'] = part.xpath('./p[@class="intro"]/text()').extract(
                )
            yield item

# -*- coding: utf-8 -*-
import scrapy

from novel.items import NovelItem


class SolveSpider(scrapy.Spider):
    name = "solve"
    allowed_domains = ["qidian.com"]
    start_urls = [];
    for x in range(1,5):#只有5页
        start_urls.append("https://www.qidian.com/all?orderId=&style=1&pageSize=20&siteid=1&pubflag=0&hiddenField=0&page=" + str(x))
    #start_urls = ["https://www.qidian.com/all?orderId=&style=1&pageSize=20&siteid=1&pubflag=0&hiddenField=0&page="]
   # page_index = ["1", "2", "3", "4", "5", "6", "7","8", "9", "10"]
    def parse(self, response):
        nolves = response.xpath('//ul[@class="all-img-list cf"]/li')
        for each in nolves:
           # print("***************************")

            item = NovelItem()
            part = each.xpath('./div[@class="book-mid-info"]')
            #print(part)
            item['bookname'] = part.xpath('./h4/a/text()').extract()
            item['link'] = part.xpath('./h4/a/@href').extract()[0]
            item['author'] = part.xpath('./p[@class="author"]/a[@class="name"]/text()').extract()
            item['category'] = part.xpath('./p[@class="author"]/a/text()').extract()
            item['content'] = part.xpath('./p[@class="intro"]/text()').extract()
            yield item
