Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

doc: add instructions to debug Scrapy spiders in Visual Studio Code

Pablo Hoffmanc04ccbceb91b
diff --git a/docs/topics/debug.rst b/docs/topics/debug.rst
index 4d452b4df..edbcaf432 100644
--- a/docs/topics/debug.rst
+++ b/docs/topics/debug.rst
@@ -150,3 +150,31 @@ available in all future runs should they be necessary again::
For more information, check the :ref:`topics-logging` section.
.. _base tag: https://www.w3schools.com/tags/tag_base.asp
+
+Visual Studio Code
+==================
+
+.. highlight:: json
+
+To debug spiders with Visual Studio Code you can use the following ``launch.json``::
+
+ {
+ "version": "0.1.0",
+ "configurations": [
+ {
+ "name": "Python: Launch Scrapy Spider",
+ "type": "python",
+ "request": "launch",
+ "module": "scrapy",
+ "args": [
+ "runspider",
+ "${file}"
+ ],
+ "console": "integratedTerminal"
+ }
+ ]
+ }
+
+
+Also, make sure you enable "User Uncaught Exceptions", to catch exceptions in
+your Scrapy spider.