首先安装插件


同时打开上面的右边的齿轮图标,就是打开文件
launch.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: Debugging in Visual Studio Code
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:3000",
            "webRoot": "${workspaceFolder}"
        }
    ]
}上面端口号根据自己需要进行设置

点击上面的爬虫图标,就可以进行跟踪运行了,目前在vscode打断点好像不行,可以通过debugger代码是可以有断点

但可以通过在Chrome里进行设置断点,如下图

上面的源文件里的行数里进行设置断点是有效的,可以进行跟踪等

上面

这个是一步步跟踪,

这个是继续运行的意思










