Skip to content

Instantly share code, notes, and snippets.

@ttilberg
Last active September 9, 2020 20:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ttilberg/d060749a02413f0abf73901cf3af13c2 to your computer and use it in GitHub Desktop.
Save ttilberg/d060749a02413f0abf73901cf3af13c2 to your computer and use it in GitHub Desktop.
Scrapy debugging in VSCode made easy.
from scrapy.cmdline import execute
try:
execute(
[
'scrapy',
'crawl',
'spidername',
# '-a',
# 'some_attr=some_value
# '-s',
# 'HTTPCACHE_ENABLED=true', # This can be uncommented for caching
# '-o',
# 'out.csv',
]
)
except SystemExit:
pass
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: debug_runner.py",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/debug_runner.py",
"console": "integratedTerminal"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment