Use code tag
Use
Then dos
Use
yield
and not return
and now you do not save the ouptut now,just get run info of scrapy.import scrapy class BasicsSpider(scrapy.Spider): name = 'ietf' allowed_domains = ['pythonscraping.com'] start_urls = ['https://pythonscraping.com/linkedin/ietf.html'] def parse(self, response): title = response.xpath('//span[@class="title"]/text()').get() yield {"title": title}So if i run this as
scrapy crawl ietf -o title.json
Then dos
title.json
has the title.Output:[
{"title": "A Standard for the Transmission of IP Datagrams on Avian Carriers"}
]