Scrapy cmdline.execute停止脚本 [英] Scrapy cmdline.execute stops script

查看:149
本文介绍了Scrapy cmdline.execute停止脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我打电话

cmdline.execute("scrapy crawl website".split())
print "Hello World"

它会在cmdline.execute之后停止脚本,并且不会运行其余的脚本并打印 Hello World。我该如何解决?

it stops the script after cmdline.execute, and doesn't run the rest of the script and print "Hello World". How do I fix this?

推荐答案

我刚刚尝试了以下代码,并且对我有用:

I have just tried the following code, and it works for me:

import os
os.system("scrapy crawl website")
print("Hello World")

这篇关于Scrapy cmdline.execute停止脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆