我想将scrapy蜘蛛对象的多个实例与polipo代理的多个实例一起使用。
为此,这非常简单:
for i in `seq 1 100`
do
numeroPortProxy=$(($i+30000))
command="scrapy crawl courses_PT ... -s HTTP_PROXY=http://127.0.0.1:${numeroPortProxy}"
eval $command&
done
我的问题是我需要自动"o"
回答命令。
我尝试了这个eval $command&<<<"o"
,但是它不起作用。日志文件指示:EOFError: EOF when reading a line
我也eval $command<<<"o" &
尝试过,它也不起作用。它在终端中显示此错误:
Usage
=====
scrapy crawl [options] <spider>
crawl: error: Invalid -s value, use -s NAME=VALUE
不满意。
因此,我该如何一次像&
运算符允许那样启动多个命令实例,并像<<<
允许那样回答每个实例的提示。