代码之家  ›  专栏  ›  技术社区  ›  ERJAN

运行selenium时,如何从vsstudioide中删除INFO.console日志?

  •  -1
  • ERJAN  · 技术社区  · 5 年前

    我只需要看看我的打印输出在终端中是什么。日志弄乱了屏幕:

    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)
    
    0 回复  |  直到 5 年前
        1
  •  0
  •   undetected Selenium    5 年前

    为了抑制一些 慰问 您可以导入的日志 warnings 模块,并添加一行如下:

    import warnings
    
    warnings.filterwarnings("ignore")