How to make portia spider run?

578 Views Asked by At

I can not send my spiders.

I use one of the following codes:

docker run -i -t --rm -v /home/raphael/Documents/entreprise/portia/portia-master/test:/app/data/projects:rw -v /home/raphael/Documents/entreprise/portia/res:/mnt:rw -p 9001:9001 scrapinghub/portia \
            portiacrawl /app/data/projects/Oscaro www.oscaro.com -o /mnt/Oscaro.jl
docker run -i -t --rm -v /home/raphael/Documents/entreprise/portia/portia-master/test:/app/data/projects:rw -v /home/raphael/Documents/entreprise/portia/res:/mnt:rw -p 9001:9001 scrapinghub/portia \
            portiacrawl /app/data/projects/Oscaro

The console me return:

+ action=portiacrawl
+ shift
+ '[' -z portiacrawl ']'
+ case $action in
+ exec portiacrawl /app/data/projects/Oscaro www.oscaro.com -o /mnt/Oscaro.jl
Usage: portiacrawl <project dir/project zip> [spider] [options]

Allow to easily run slybot spiders on console. If spider is not given, print a
list of available spiders inside the project

Options:
  -h, --help            show this help message and exit
  --settings=SETTINGS   Give specific settings module (must be on python path)
  --logfile=LOGFILE     Specify log file
  -a NAME=VALUE         Add spider arguments
  -s NAME=VALUE         Add extra scrapy settings
  -o FILE, --output=FILE
                        dump scraped items into FILE (use - for stdout)
  -t FORMAT, --output-format=FORMAT
                        format to use for dumping items with -o (default:
                        jsonlines)
  -v, --verbose         more verbose

However, this seems to be a good adaptation of the documentation code:

docker run -i -t --rm -v <PROJECTS_FOLDER>:/app/data/projects:rw -v <OUPUT_FOLDER>:/mnt:rw -p 9001:9001 scrapinghub/portia \
    portiacrawl /app/data/projects/PROJECT_NAME SPIDER_NAME -o /mnt/SPIDER_NAME.jl

I am completely new to docker, portia and scrapy.

I have trouble idantifying the sorce of the problem.

By the way, I did not understand the solution proposed here: https://emu.one/scrapy/823487/how-do-i-start-running-portia-spider-how-to-do-it.html

I do not know if this solution concerns me since it does not seem to be used docker.

I also have a question about the first part of the code. I would like to know what is done that I write:

-v /home/raphael/Documents/entreprise/portia/portia-master/test:/app/data/projects

I thank you in advance

1

There are 1 best solutions below

0
On

It was necessary to put a relative path. :(

docker run -i -t --rm -v ~/Documents/entreprise/portia/portia-master/test:/app/data/projects:rw -v ~/Documents/entreprise/portia/res:/mnt:rw -p 9001:9001 scrapinghub/portia \
            portiacrawl /app/data/projects/Oscaro www.oscaro.com -o /mnt/Oscaro.jl