為什么scrapy.Spider和def parse(self,response)簽名不匹配?
import scrapy
from mypro.items import MyproItem
class WeisuenSpider(scrapy.Spider):
name = 'weisuen'
allowed_domains = ['sina.com.cn']
start_urls = ('http://tech.sina.com.cn/d/s/2016-09-17/doc-ifxvyqwa3324638.shtml')
def parse(self,response):
item=MyproItem()
item.title=response.xpath("/html/head/title/text()")
print(item.title)
和書上網上代碼一樣,就是輸出不了,沒有回應資料
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/253208.html
下一篇:為什么只能正則出第一列資料?
