在VSCode中调试Python爬虫,你可以按照以下步骤操作:
Ctrl+Shift+X
(在Mac上是Cmd+Shift+X
)。Ctrl+,
(在Mac上是Cmd+,
)。my_spider.py
,并编写你的爬虫代码。launch.json
文件中,找到“configurations”数组,添加一个新的配置项,如下所示:{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
"remotePath": "",
和"webRoot": "${workspaceFolder}/your_web_root_directory",
到你的配置项中,其中your_web_root_directory
是你的网页代码所在的目录。请注意,具体的调试步骤可能因你的爬虫代码和使用的库而有所不同。如果你遇到任何问题,请查阅VSCode和Python扩展的文档以获取更多信息。
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:vscode python爬虫怎样配置