This commit is contained in:
2025-10-31 16:45:16 +08:00
parent b577fbd719
commit 7dcbfad4a2
4 changed files with 229 additions and 7 deletions
+8 -1
View File
@@ -15,7 +15,7 @@ class Sinopec_ewcc(object):
self.url_info= 'ewcc.sinopec'
self.browser_path= r'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe'
self.co = ChromiumOptions().set_browser_path(self.browser_path)
self.co.headless(True)
# self.co.headless(True)
self.co.ignore_certificate_errors(True)
self.browser=Chromium(self.co)
self.tab=self.browser.latest_tab
@@ -26,6 +26,13 @@ class Sinopec_ewcc(object):
self.is_query_oil_current_month_lj=False
self.is_query_client_emp_tj=False
def reset(self):
# 关闭当前浏览器
self.browser.quit()
self.browser=Chromium(self.co)
self.tab=self.browser.latest_tab
def quit(self):
self.browser.quit()
logger.info(f"浏览器已退出")