Hello I am trying to build a simple crawler from scrapy.
The code works fine in scrapy shell but when I run it through console it doesn't write anything to json file.
I am running it from project top directory as
scrapy crawl filemare -o filemare.json
import scrapy
class FilemareSpider(scrapy.Spider):
name = "filemare"
allowed_domains = ['https://filemare.com/']
start_urls = ["https://filemare.com/en-
us/search/firmware%20download/632913359"]
def parse(self, response):
items = response.xpath('//div[@class="f"]/text()').extract()
#items = response.css('div.f::text').extract()
for url in items:
print(url)
yield url