|
I'm using VSCode to write Scrapy code, but I'm unable to get code completion (autocompletion/suggestions) for Scrapy classes, methods, or modules. This forces me to type everything manually, which significantly slows down my workflow. I'm unsure if Scrapy natively supports this feature or if it requires specific configuration. If it's possible, how should I set it up? Additional context: I use uv to manage my Python environments (e.g., virtual environments created via uv venv). Installed the official Python extension by Microsoft. When typing self. or yield, VSCode should suggest Scrapy-specific methods like self.crawl() or FormRequest automatically. Actual behavior: No suggestions appear for Scrapy-related code, though basic Python syntax (e.g., print() works fine. Questions for the community: Does Scrapy require additional setup (e.g., stubs, type hints) for code completion to work? |
Replies: 2 comments 6 replies
I don't think this makes sense, as |
|
I found the problem. Conclusion: |

No, the IDE can't know what type is the
responsevariable unless you add a type hint (at least in callbacks not namedparse, asSpider.parse()is typed and it looks like e.g. PyCharm analyzes its type hint).Ah. The shell completion for
scrapyis implemented in https://github.com/scrapy/scrapy/blob/master/extras/scrapy_bash_completion (pip install scrapywon't install it, of course).