scrapy-mongodb | Mongodb support for scrapy | Continuous Deployment library
kandi X-RAY | scrapy-mongodb Summary
kandi X-RAY | scrapy-mongodb Summary
Mongodb support for scrapy
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Process a single item .
- Initialize the collection .
- Create an instance from a given crawler .
scrapy-mongodb Key Features
scrapy-mongodb Examples and Code Snippets
Community Discussions
Trending Discussions on scrapy-mongodb
QUESTION
I'm exporting a series of mongo collections to csv files. I'm explicitly setting the field names to export by calling a dictionary, if a field does not exist in a given document, I would still like to create an empty field in the csv column
I'm currently getting these errors in my console:
too many positional arguments: ['pfrm_uid', 'mark']]
This occurs for all collections. I find it most strange that there are 2 closing brackets in the error.
...ANSWER
Answered 2017-Mar-07 at 00:44mongoexport script expects comma separated fields as a string for the fields argument.
You can test and see that this is not such a string:
QUESTION
How do I get scrapy pipeline to fill my mongodb with my items? Here is what my code looks like at the moment which is a reflection of the information i got off of scrapy documentation.
I also want to mention that I have tried returning items instead of yielding, as well tried using item loaders. All methods seem to have the same outcome.
on that note I want to mention that if I run the command
mongoimport --db mydb --collection mycoll --drop --jsonArray --file ~/path/to/scrapyoutput.json
my database gets populated(as long as I yield and don't return items)... I would really love to get this pipeline working though...
okay so here is my code:
here is my spider
...ANSWER
Answered 2017-Feb-28 at 22:18Typo where you're setting the DB name:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install scrapy-mongodb
You can use scrapy-mongodb like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page