diff --git a/DrissionPage/__init__.py b/DrissionPage/__init__.py index 632411f..06964d5 100644 --- a/DrissionPage/__init__.py +++ b/DrissionPage/__init__.py @@ -14,4 +14,4 @@ from ._configs.chromium_options import ChromiumOptions from ._configs.session_options import SessionOptions __all__ = ['ChromiumPage', 'ChromiumOptions', 'SessionOptions', 'SessionPage', 'WebPage', '__version__'] -__version__ = '4.0.0b38' +__version__ = '4.0.2' diff --git a/DrissionPage/_configs/configs.ini b/DrissionPage/_configs/configs.ini index 2eb7adb..3872ad9 100644 --- a/DrissionPage/_configs/configs.ini +++ b/DrissionPage/_configs/configs.ini @@ -5,7 +5,7 @@ tmp_path = [chromium_options] address = 127.0.0.1:9222 browser_path = chrome -arguments = ['--no-default-browser-check', '--disable-suggestions-ui', '--no-first-run', '--disable-infobars', '--disable-popup-blocking'] +arguments = ['--no-default-browser-check', '--disable-suggestions-ui', '--no-first-run', '--disable-infobars', '--disable-popup-blocking', '--hide-crash-restore-bubble'] extensions = [] prefs = {'profile.default_content_settings.popups': 0, 'profile.default_content_setting_values': {'notifications': 2}} flags = {} diff --git a/DrissionPage/_units/downloader.py b/DrissionPage/_units/downloader.py index 77a4e7c..8f7f2b5 100644 --- a/DrissionPage/_units/downloader.py +++ b/DrissionPage/_units/downloader.py @@ -126,7 +126,10 @@ class DownloadManager(object): :return: None """ mission.state = 'canceled' - self._browser.run_cdp('Browser.cancelDownload', guid=mission.id) + try: + self._browser.run_cdp('Browser.cancelDownload', guid=mission.id) + except: + pass if mission.final_path: Path(mission.final_path).unlink(True) @@ -136,7 +139,10 @@ class DownloadManager(object): :return: None """ mission.state = 'skipped' - self._browser.run_cdp('Browser.cancelDownload', guid=mission.id) + try: + self._browser.run_cdp('Browser.cancelDownload', guid=mission.id) + except: + pass def clear_tab_info(self, tab_id): """当tab关闭时清除有关信息 diff --git a/setup.py b/setup.py index 1bef642..f228274 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ with open("README.md", "r", encoding='utf-8') as fh: setup( name="DrissionPage", - version="4.0.0b38", + version="4.0.2", author="g1879", author_email="g1879@qq.com", description="Python based web automation tool. It can control the browser and send and receive data packets.", @@ -37,7 +37,7 @@ setup( python_requires='>=3.6', entry_points={ 'console_scripts': [ - 'dp = DrissionPage.commons.cli:main', + 'dp = DrissionPage.functions.cli:main', ], }, )