Replicating scrapy shell capabilities in PyCharm python console

How do I run emulation scrapy shell

inside PyCharm IPython console? I want to keep the ability to run snippets of code from the editor using Alt + Shift + E

+3


source to share


2 answers


I got it by running the following python snippet:

from scrapy.cmdline import execute
import sys
sys.argv = ['scrapy', 'shell', 'http://scrapy.org']
execute()

      

If you get the following error:



MultipleInstanceError: Multiple incompatible subclass instances of InteractiveShellEmbed are being created.

      

then you need to add the following line to scrapy.cfg:

shell=python

      

+2


source


You have a terminal icon at the bottom of your pycharm window.

enter image description here



It opens a new terminal in which you can run scrapy shell

.

+1


source







All Articles