首页| 论坛| 消息
主题:xpath抓取的值有空格换行符等问题
回帖:# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy

class TutorialItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass

class DmozItem(scrapy.Item):
title = scrapy.Field()
link = scrapy.Field()
desc = scrapy.Field()

class QuoteItem(scrapy.Item):
text = scrapy.Field()
author = scrapy.Field()
#link = scrapy.Field()
下一楼›:a/@href

contains(str1, str2) # str1中有str2,则返回true,例如以下表达式输出链接文 ..
‹上一楼:import scrapy
class QuoteSpider(scrapy.Spider):
name = 'quote'
start_u ..

查看全部回帖(10)
«返回主帖