Browse Source

anhui rollback

zhangfan 2 months ago
parent
commit
f3ef8e6b0c
1 changed files with 6 additions and 5 deletions
  1. 6 5
      crossborder/anhui/crawl_gov_anhui_full.py

+ 6 - 5
crossborder/anhui/crawl_gov_anhui_full.py

@@ -210,16 +210,17 @@ def check_internet_connection(url="http://www.baidu.com", timeout=5):
         return False
 
 def crawl_with_selenium(url, mark):
-    if not check_internet_connection():
-        log.error("无法连接到互联网,请检查网络设置")
-        raise Exception("网络连接失败")
+    # if not check_internet_connection():
+    #     log.error("无法连接到互联网,请检查网络设置")
+    #     raise Exception("网络连接失败")
 
     driver = None
     year_month = None
     try:
         # 使用WebDriverManager自动管理geckodriver
-        service = Service(GeckoDriverManager().install())
-        driver = webdriver.Firefox(service=service, options=configure_stealth_options())
+        # service = Service(GeckoDriverManager().install())
+        # driver = webdriver.Firefox(service=service, options=configure_stealth_options())
+        driver = webdriver.Firefox(options=configure_stealth_options())
         log.info("Firefox WebDriver初始化成功")
 
         year_month = None