关于取消DevTools listening on ws://127.0.0.1…提示的方法

2023-07-11,,

Python代码写好之后,通过任务计划程序定期执行.py文件,但总会有命令窗口,虽然不影响程序执行,但每次需要手动叉掉比较烦。于是我网上搜索了一些方法

网上的方法并没有直接解决我的问题,但我借助搜索引擎和chatGPT,成功将代码进行了优化。供大家参考。

from selenium import webdriver
from selenium.webdriver.chrome.service import Service chrome_path = 'E:\Python\chromedriver.exe' options = webdriver.ChromeOptions()
options.add_experimental_option('excludeSwitches', ['enable-logging']) service = Service(executable_path=chrome_path)
driver = webdriver.Chrome(service=service, options=options) driver.get("http://www.baidu.com")
print("程序运行成功")

  

在学习Python的过程中,我不断看到其他人优秀的代码,不断从中汲取新的知识和技巧。同时,我也明白分享是一种双赢的行为,因此我始终将自己的学习经验和心得分享给其他人,希望能够为更多的人带来帮助和启发。

 
 
 

 

关于取消DevTools listening on ws://127.0.0.1…提示的方法的相关教程结束。

《关于取消DevTools listening on ws://127.0.0.1…提示的方法.doc》

下载本文的Word格式文档,以方便收藏与打印。