|
@@ -6,6 +6,7 @@ Created on 2023-05-10
|
|
|
---------
|
|
|
@author: Dzr
|
|
|
"""
|
|
|
+import copy
|
|
|
import threading
|
|
|
|
|
|
import bson
|
|
@@ -68,18 +69,24 @@ class MonitorParser(threading.Thread):
|
|
|
except requests_exceptions.SSLError:
|
|
|
url = url.replace('https', 'http')
|
|
|
request = Request(url=url, render=True, **kwargs)
|
|
|
+ except requests_exceptions.ConnectionError:
|
|
|
+ kw = copy.deepcopy(kwargs)
|
|
|
+ kw.pop('proxies', '')
|
|
|
+ request = Request(url=url, render=True, **kw)
|
|
|
except requests_exceptions as e:
|
|
|
logger.exception(e)
|
|
|
break
|
|
|
|
|
|
+ # 释放浏览器
|
|
|
+ response.close_browser(request)
|
|
|
+
|
|
|
logger.debug(
|
|
|
"""
|
|
|
- -------------- response for ----------------
|
|
|
- thread = %s
|
|
|
+ -------------- %s response for ----------------
|
|
|
url = %s
|
|
|
title = %s
|
|
|
response = %s
|
|
|
- """
|
|
|
+ """
|
|
|
% (
|
|
|
self.getName(),
|
|
|
url,
|