I have an array
myArray = array(url1,url2,...,url90)
I want to execute this commande 3 times in parallel
scrapy crawl mySpider -a links=url
and each time with 1 url,
scrapy crawl mySpider -a links=url1
scrapy crawl mySpider -a links=url2
scrapy crawl mySpider -a links=url3
and when the first one finish his job, he will get the other url like
scrapy crawl mySpider -a links=url4
I read this question, and this one and I try this:
import threading
from threading import Thread
def func1(url):
scrapy crawl mySpider links=url
if __name__ == '__main__':
myArray = array(url1,url2,...,url90)
for(url in myArray):
Thread(target = func1(url)).start()