4
votes

How can I run the scrapy shell emulation inside PyCharm IPython console? I want to keep the ability to run snippets of code from editor by Alt+Shift+E

2

2 Answers

5
votes

I got it working 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 have to add to the scrapy.cfg the following line:

shell=python
0
votes

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

enter image description here

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