python - 不允许启动 AudioContext。必须恢复(或创建)
问题描述
所以我的脚本由于某种原因现在在我运行它时给了我当前的错误。它是一个硒项目,可以无头打开浏览器。它工作得很好。
DevTools listening on ws://127.0.0.1:50010/devtools/browser/a0bd7321-8810-4867-9a1a-44830cabb881
[0531/093705.662:INFO:CONSOLE(483)] "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio", source: https://thesite/TSPD/082a057379ab2000e04675d6650b7d08e00fa87e834636f3276a953aff91cafadccfc9f4abbb23b7?type=8 (483)
[0531/093705.665:INFO:CONSOLE(483)] "The ScriptProcessorNode is deprecated. Use AudioWorkletNode instead. (https://developers.google.com/web/updates/2017/12/audio-worklet)", source: https://thesite/TSPD/082a057379ab2000e04675d6650b7d08e00fa87e834636f3276a953aff91cafadccfc9f4abbb23b7?type=8 (483)
[0531/093705.668:INFO:CONSOLE(487)] "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio", source: https://thesite/TSPD/082a057379ab2000e04675d6650b7d08e00fa87e834636f3276a953aff91cafadccfc9f4abbb23b7?type=8 (487)
[0531/093705.668:INFO:CONSOLE(488)] "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio", source: https://thesite/TSPD/082a057379ab2000e04675d6650b7d08e00fa87e834636f3276a953aff91cafadccfc9f4abbb23b7?type=8 (488)
[0531/093705.669:ERROR:web_contents_delegate.cc(225)] WebContentsDelegate::CheckMediaAccessPermission: Not supported.
我打算称该站点为“thesite”,因为它是私有的。
解决方案
所以我找到了错误和信息的答案:控制台。
对于我刚刚添加的错误:
options.add_argument("--use-fake-ui-for-media-stream")
对于信息:控制台:
options.add_argument("--log-level=3")
推荐阅读
- kibana - ELK - 格式化 SIEM 警报
- python - 高效地计算矩阵中所有行的运算
- python-3.x - 自定义模型功能上的 Django 管理员 list_filter
- electron - ElectronJS 上的会话问题
- python-3.x - 如何从雪花中的“存储集成”中选择价值?
- javascript - 删除某些重复的单词并重新排列字符串中的单词
- hadoop - 安装 hadoop-3.1.4 'hdfs' 时出错,未重新配置
- python - 如何在 Python 中通过匹配外部列表中的一个值来提取列表中的列表?
- javascript - 我可以在更新类组件状态的函数组件中触发 onclick 事件吗?
- php - 如何在 php 中将 unicode 字符从“孤立”的上下文形式更改为通用 Unicode 阿拉伯语