【问题标题】:how to remove INFO.console logs from vs studio ide when running selenium?运行 selenium 时如何从 vs studio ide 中删除 INFO.console 日志?
【发布时间】:2020-07-22 08:24:57
【问题描述】:

我只需要在终端中查看我的打印输出。日志使屏幕混乱:

DevTools listening on ws://127.0.0.1:59844/devtools/browser/9c6d16aa-c1da-4e4e-88c3-619a6377616d

DevTools listening on ws://127.0.0.1:59859/devtools/browser/5868a5b2-3eb1-4d2e-aec4-d97cbb858069
[0722/142212.508:ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
[0722/142215.435:INFO:CONSOLE(3)] "A preload for 'https://yastatic.net/pcode-bundles/0.1788/banners.js' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.", source: https://tengrinews.kz/js/loader.js?v=268 (3)
DevTools listening on ws://127.0.0.1:59903/devtools/browser/3947b095-cfc8-49b9-b6b4-2702fe02fe6e
[0722/142220.093:ERROR:command_buffer_proxy_impl.cc(122)] ContextResult::kTransientFailure: Failed to send GpuChannelMsg_CreateCommandBuffer.
[0722/142223.038:INFO:CONSOLE(3)] "A preload for 'https://yastatic.net/pcode-bundles/0.1788/banners.js' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.", source: https://tengrinews.kz/js/loader.js?v=268 (3)

【问题讨论】:

    标签: python selenium logging visual-studio-code


    【解决方案1】:

    要抑制某些 Console 日志,您可以导入 warnings 模块并添加一行:

    import warnings
    
    warnings.filterwarnings("ignore")
    

    【讨论】:

    • @ERJAN 我有时也会在我的 windows 本地主机上使用它,它按预期工作。
    猜你喜欢
    • 2017-04-16
    • 1970-01-01
    • 2017-03-11
    • 2010-12-01
    • 2019-08-25
    • 2020-09-05
    • 2011-05-21
    • 1970-01-01
    • 2020-02-05
    相关资源
    最近更新 更多