Good evening. I'm using python for the first time in order to run a crawler. I was able to run and get the acquisitions and I want to save them on MongoDB via pymongo. I tried to follow the official documentation but for some reason I can not. Does anyone know how to insert or have done something like this? Hugs.
import scrapy
import pymongo
from pymongo import MongoClient
class NameSpider(scrapy.Spider):
name = 'SpiderName'
allowed_domains = ['randomDomain']
start_urls = ['randomDomain Url']
def parse(self, response):
data = []
for selector in response.css("span.style_data"):
data.append(selector.css("::text").extract()
print(data)
# O data aparece como desejado,agora desejo salvar seu conteudo no MongoDB.