python - 无法使用用户数据目录 msedge
问题描述
我在这里遇到问题我正在尝试运行边缘(来自 msedge-selenium-tools)并且它没有打开默认配置文件,这是代码:
from msedge.selenium_tools import Edge
from msedge.selenium_tools import EdgeOptions
edgeoptions = EdgeOptions()
edgeoptions.add_argument(R"user-data-dir=C:\Users\User\AppData\Local\Microsoft\Edge\User Data")
driver = Edge("msedgedriver.exe",options=edgeoptions)
driver.get("https://google.com")
它不加载配置文件,是的,有没有办法摆脱边缘被固定到任务栏?提前致谢!
编辑:我一直没有注意到回溯:
[3972:7544:0727/224625.954:ERROR:device_event_log_impl.cc(214)] [22:46:25.954] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)
[3972:7544:0727/224625.961:ERROR:profile_manager.cc(1058)] Cannot create profile at path C:\Users\User\AppData\Local\Microsoft\Edge\User Data\Default
[3972:7544:0727/224625.961:ERROR:profile_manager.cc(2038)] Cannot create profile at path C:\Users\User\AppData\Local\Microsoft\Edge\User Data\Default
[3972:7544:0727/224626.122:ERROR:secondary_tile_client.cc(219)] OnSecondaryTileManagerDisconnected. Sending error response to callbacks
[3972:7544:0727/224633.600:ERROR:CONSOLE(1355)] "Uncaught (in promise) undefined", source: https://assets.msn.com/bundles/v1/edgeChromium/latest/common.2c045991234e451853e9.js (1355)
解决方案
好的,我解决了我的问题
谢谢大家编辑:我用过
edgeoptions.use_chromium = True
推荐阅读
- javascript - 另一个只结束一次时自动播放 html5 视频
- ios - 如何逐帧在视频上添加文本标签 - iOS swift
- python - 调用 API 时在 JSON 中添加键值
- java - 输入数据的数组问题
- php - 如何使整行可点击?
- amazon-s3 - 如何使用 aws CodeDeploy 自动部署从 s3 存储桶到 ec2 实例?
- javascript - ThreeJs 中的可交互网格
- python - Numpy - Anaconda Tensorflow GPU 错误
- model-view-controller - 使用 service worker 运行项目后自动创建的“~”符号
- python - 在 tensorflow 训练和测试中显示不同的结果