headless无头浏览器模式下有很多日志信息,如下,
将日志等级设定为 3 即可
chrome_options.add_argument('log-level=3')
#info(default) = 0
#warning = 1
#LOG_ERROR = 2
#LOG_FATAL = 3
DevTools listening on ws://127.0.0.1:55019/devtools/browser/472a41e1-3529-48c2-8f96-4b2ae0861b12
[1217/154711.234:INFO:CONSOLE(28)] "[ Logic-error ] [object Object]", source: https://webresource.c-ctrip.com/code/cquery/cQuery_110421.js (28)
[1217/154711.289:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at http://baidu.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and
https://www.chromestatus.com/feature/5633521622188032.", source: https://www.ctrip.com/ (0)
[1217/154711.401:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at http://cdid.c-ctrip.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.", source: https://www.ctrip.com/ (0)
[1217/154712.598:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at http://doubleclick.net/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.", source: https://www.ctrip.com/ (0)
[1217/154713.180:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at http://gtags.net/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and
https://www.chromestatus.com/feature/5633521622188032.", source: https://www.ctrip.com/ (0)
[1217/154717.774:INFO:CONSOLE(1997)] "Mixed Content: The page at 'https://www.ctrip.com/' was loaded over a
secure connection, but contains a form that targets an insecure endpoint 'http://hotels.ctrip.com/hotel/16296689.html#ctm_ref=ctr_hp_sb_lst'. This endpoint should be made available over a secure connection.", source: https://webresource.c-ctrip.com/pub/981d5e8a/6aa58be5/e153deab/1e5e5c50.js (1997)
[1217/154717.778:INFO:CONSOLE(2153)] "Mixed Content: The page at 'https://www.ctrip.com/' was loaded over a
secure connection, but contains a form that targets an insecure endpoint 'http://hotels.ctrip.com/hotel/16296689.html#ctm_ref=ctr_hp_sb_lst'. This endpoint should be made available over a secure connection.", source: https://webresource.c-ctrip.com/pub/981d5e8a/6aa58be5/e153deab/1e5e5c50.js (2153)
[1217/154718.253:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at http://cdid.c-ctrip.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.", source: https://hotels.ctrip.com/hotel/16296689.html#ctm_ref=ctr_hp_sb_lst (0)
[1217/154720.116:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at http://baidu.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and
https://www.chromestatus.com/feature/5633521622188032.", source: https://hotels.ctrip.com/hotel/16296689.html#ctm_ref=ctr_hp_sb_lst (0)
[1217/154722.558:INFO:CONSOLE(0)] "A cookie associated with a cross-site resource at http://doubleclick.net/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.", source: https://hotels.ctrip.com/hotel/16296689.html#ctm_ref=ctr_hp_sb_lst (0)
selenium下webdriver一直报错
[142012:46732:0709/105443.557:ERROR:ssl_client_socket_impl.cc(1026)] handshake failed; returned -1, SSL error code 1, net_error -101
将屏蔽日志信息等级设置为3,屏蔽error即可。