0

I have a scrapy script which will run multiple spiders. I want to crawl the single spider or run the multiple spider script from PHP/HTML code. Is that possible? If so, how?

Tom Zych
  • 13,329
  • 9
  • 36
  • 53
Sabeena
  • 85
  • 12
  • 1
    Does [this documentation](http://doc.scrapy.org/en/latest/topics/practices.html#run-scrapy-from-a-script) answer your question? – Matt Hall Nov 22 '15 at 23:46

1 Answers1

0

Try this in PHP:

Add this line in your python script:

#!/usr/bin/env python

Make the script executable:

chmod +x myscript.py

Execute the file using something like this:

<?php 

$command = escapeshellcmd('/home/myscript.py');
$output = shell_exec($command);
echo $output;

?>
Rahul
  • 3,208
  • 8
  • 38
  • 68