How to get the project id in a scrapy job

Posted about 2 years ago by Alejandro Ueno

Post a topic
Answered
A
Alejandro Ueno

I want to get the scrapy project id that zyte generates, is there any other method different to the os.getenv('SCRAPY_JOB')?. This method generates  a response in the format  "project_id/spider_id/job_id" but I only want the project id, is there a method to extract directly the project id or do I have to use split functions to get it? 

0 Votes

Bala Ravichandran

Bala Ravichandran posted about 2 years ago Admin Best Answer

This is the default response format  "project_id/spider_id/job_id". Yes, you can split functions to get the project ID.

1 Votes


1 Comments

Bala Ravichandran

Bala Ravichandran posted about 2 years ago Admin Answer

This is the default response format  "project_id/spider_id/job_id". Yes, you can split functions to get the project ID.

1 Votes

Login to post a comment