diff --git a/main.py b/main.py index 5010751..ac623e2 100644 --- a/main.py +++ b/main.py @@ -399,4 +399,5 @@ def stop(): stop_btn.click(fn=stop, inputs=None, outputs=[go_ui, stop_btn, qr_image, gt_row], ) # 运行应用 + print("点击下面的网址运行程序 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓") demo.launch() diff --git a/util/configUtil.py b/util/configUtil.py index 293fec4..2de2065 100644 --- a/util/configUtil.py +++ b/util/configUtil.py @@ -19,7 +19,16 @@ def __init__(self, config_file_path): def _login_and_save_cookies(self, login_url="https://show.bilibili.com/platform/home.html"): logging.info("启动浏览器中.....") - self.driver = webdriver.Edge() + try: + self.driver = webdriver.Edge() + except Exception as e: + try: + self.driver = webdriver.Chrome() + except Exception as e: + raise Exception("没有找到浏览器驱动,请根据自己的浏览器下载相应的驱动:\n" + "相关教程:https://blog.csdn.net/zz00008888/article/details/127903475\n" + "Edge: https://liushilive.github.io/github_selenium_drivers/md/IE.html\n" + "Chrome:https://liushilive.github.io/github_selenium_drivers/md/Chrome.html\n") self.wait = WebDriverWait(self.driver, 0.5) self.driver.get(login_url) self.driver.maximize_window()