scrapinghub/python-scrapinghub

How to get job_arguments?

bulatbulat48 opened this issue · 3 comments

We can run the jobs with job_args.

project.jobs.run('spider1', job_args={'arg1': 'val1'})

but we can't get arguments from finished jobs:

project.jobs.list(count=1, spider='spider')

Looks like Scrapy Cloud doesn't have job arguments method in the API:
https://docs.zyte.com/scrapy-cloud/jobq.html#jobq-project-id-list

Good day @bulatbulat48. I believe you can get the job arguments via

project.jobs.list(count=1, spider='spider', meta=['spider_args'])

Other keys can be found at https://docs.zyte.com/scrapy-cloud/jobmeta.html. Although not sure where the meta API parameter itself is documented.

@hermit-crab it works! Thank you!