python - 如何在 VS Code 上将 Intellisense 用于 Selenium?
问题描述
我不能在 VSCODE 上对 Selenium 使用 Intellisense 或高亮显示。例如,键入时不提供“send_keys”命令,或者“driver.find_element_by_xpath”不是彩色的。我已经安装了 Python 扩展并寻找 Selenium 扩展,但没有找到任何东西。
这是我的settings.json:
{
"editor.suggestSelection": "first",
"python.languageServer": "Microsoft",
"python.pythonPath": "/usr/local/opt/python/bin/python3.7",
"editor.fontSize": 14,
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.linting.flake8Enabled": false,
"python.autoComplete.extraPaths": [
],
"java.semanticHighlighting.enabled": true,
"vsintellicode.modelDownloadPath": ""
}
解决方案
目前看来VS Code不支持提示“sent_keys()”;至于“driver.find_element_by_xpath”的颜色显示,您可以尝试不同的主题扩展,它们会显示颜色,例如“Tokyo Hack”、“SynthWave'84”。
推荐阅读
- javascript - 错误:对象作为 React 子项无效。如果您打算渲染一组子项,请改用数组。从 JSON 获取数据
- amazon-web-services - DynamoDB 项目列表中的分页
- kubernetes - 订阅 Google Cloud pub/sub 的 kubernetes pod 的多个副本
- python - CSS仅适用于少数html文件而不是休息
- excel - 一张纸上的下标超出范围问题,但新纸上没有
- reactjs - 将值传递给道具 - 反应
- javascript - 如何在 playwright 中将多个 storageStates 加载到单个上下文中
- monaco-editor - 如何以编程方式仅触发 monaco-editor 中的文档框
- tsql - 是否有特定的方法(查询)来查找数据库中所有表的行数,条件为一年左右?
- vb.net - 如何将带有“!@@@”的字符串格式函数从vb6.0迁移到vb.net?