Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run a job? #60

Closed
ollieglass opened this issue Mar 28, 2017 · 6 comments
Closed

How to run a job? #60

ollieglass opened this issue Mar 28, 2017 · 6 comments

Comments

@ollieglass
Copy link

I can't see how to run a job. There's two examples in the docs. In the project section:

For example, to schedule a spider run (it returns a job object):

>>> project.jobs.run('spider1', job_args={'arg1':'val1'})
<scrapinghub.client.Job at 0x106ee12e8>>

and in the spider section:

Like project instance, spider instance has jobs field to work with the spider's jobs.

To schedule a spider run:

>>> spider.jobs.run(job_args={'arg1:'val1'})
<scrapinghub.client.Job at 0x106ee12e8>>

Neither works, both throw AttributeError: 'Jobs' object has no attribute 'run'

@ollieglass
Copy link
Author

ollieglass commented Mar 28, 2017

Turns out the method is called schedule, not run. Perhaps the docs should be updated to show this

@jesuslosada
Copy link
Contributor

Hi @ollieglass . It looks like you are using python-scrapinghub 1.9.0 (schedule is the right method in that version). You can read the documentation for that version here:
https://github.com/scrapinghub/python-scrapinghub/tree/1.9.0
https://pypi.python.org/pypi/scrapinghub/1.9.0

The documentation in the master branch is currently being updated for the next major release (2.0.0).

@chekunkov
Copy link
Contributor

Documentation is available via Read The Docs now. Please install latest stable version from PyPI and try again @ollieglass, you were definitely using old version.

@ollieglass
Copy link
Author

This was with scrapinghub 2.0.0.dev0

@chekunkov
Copy link
Contributor

Right, that changed here after 2.0.0.dev0 was released, and you saw docs from master branch. Sorry for the inconvenience, everything should be consistent now as we released a stable version.

@FM1337
Copy link

FM1337 commented Oct 10, 2017

I'm getting the same error, I've upgraded to the latest version and it still doesn't work. What am I doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants