scrapinghub / portia

Visual scraping for Scrapy
BSD 3-Clause "New" or "Revised" License
9.28k stars 1.41k forks source link

slyd API error #646

Closed eng1neer closed 7 years ago

eng1neer commented 7 years ago

Looks like the docs out there are outdated: https://github.com/scrapinghub/portia/tree/master/slyd

After running Portia on Docker, I was able to execute GET projects API request:

localhost:9001/api/projects

However when trying to add a new project:

curl -d '{"cmd": "create", "args": ["project_X"]}' http://localhost:9001/api/projects

It errors:

TypeError at /api/projects
create() takes exactly 1 argument (2 given)
Request Method: POST
Request URL:    http://localhost:9001/api/projects
Django Version: 1.10.1
Exception Type: TypeError
Exception Value:    
create() takes exactly 1 argument (2 given)
Exception Location: /usr/local/lib/python2.7/dist-packages/rest_framework/views.py in dispatch, line 463
Python Executable:  /usr/bin/python
Python Version: 2.7.6
Python Path:    
['/app/portia_server',
 '/app/portia_server',
 '/app/slyd',
 '/app/slybot',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/usr/lib/python2.7/lib-old',
 '/usr/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/dist-packages',
 '/usr/lib/python2.7/dist-packages']

I tried to change the payload (and even no payload at all), the error is the same.

ruairif commented 7 years ago

Wiil be fixed in Portia 2.0. Thanks for debugging the issue for us