abstract-webtools 0.1.4.11__py3-none-any.whl → 0.1.4.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -517,7 +517,7 @@ class SafeRequest:
517
517
  self.wait_between_requests()
518
518
 
519
519
  for _ in range(self.max_retries):
520
-
520
+ try:
521
521
  response = self.session.get(url=self.url_manager.correct_url, timeout=10) # 10 seconds timeout
522
522
  if response.status_code == 200:
523
523
  self.last_request_time = get_time_stamp()
@@ -525,10 +525,17 @@ class SafeRequest:
525
525
  elif response.status_code == 429:
526
526
  logging.warning(f"Rate limited by {self.url_manager.correct_url}. Retrying...")
527
527
  get_sleep(5) # adjust this based on the server's rate limit reset time
528
+ except requests.Timeout as e:
529
+ logging.error(f"Request to {cleaned_url} timed out: {e}")
530
+ except requests.ConnectionError:
531
+ logging.error(f"Connection error for URL {cleaned_url}.")
532
+ except requests.Timeout:
533
+ logging.error(f"Request timeout for URL {cleaned_url}.")
534
+ except requests.RequestException as e:
535
+ logging.error(f"Request exception for URL {cleaned_url}: {e}")
536
+
528
537
  logging.error(f"Failed to retrieve content from {self.url_manager.correct_url} after {self.max_retries} retries.")
529
538
  return None
530
-
531
-
532
539
  @staticmethod
533
540
  def is_valid_url(url):
534
541
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: abstract-webtools
3
- Version: 0.1.4.11
3
+ Version: 0.1.4.12
4
4
  Summary: Abstract Web Tools is a Python package that provides various utility functions for web scraping tasks. It is built on top of popular libraries such as `requests`, `BeautifulSoup`, and `urllib3` to simplify the process of fetching and parsing web content.
5
5
  Home-page: https://github.com/AbstractEndeavors/abstract_essentials/tree/main/abstract_webtools
6
6
  Author: putkoff
@@ -1,11 +1,11 @@
1
1
  abstract_webtools/__init__.py,sha256=2SWEfdPDHqqjUYsOQYlaOHF644ZYcO160nWKiAjga4w,34
2
2
  abstract_webtools/abstract_crawler.py,sha256=e8jVVv1_EB8poqlrdQaJ19z9Z0t8un5uc-DKnj1Ud5s,8002
3
- abstract_webtools/abstract_webtools.py,sha256=TySJ0EN4oMB7BXL7MQjB_K882pEeTeCpD0tNK-9wkX0,39673
3
+ abstract_webtools/abstract_webtools.py,sha256=sjrsbUa4AkFD80usyU2D2Ez966N_kDt_j4hf2-c7AkQ,40159
4
4
  abstract_webtools/abstract_webtools2.py,sha256=dlhhgmUTaN_NgkT6GcJMVBLuXjmW38gAOeCrKxYqytk,30685
5
5
  abstract_webtools/grab_source_gui.py,sha256=w7vDsEu1IfOIzcsfWeP2IpdS3yhFA_x5IVIeLFlfppw,14708
6
6
  abstract_webtools/main.py,sha256=_I7pPXPkoLZOoYGLQDrSLGhGuQt6-PVyXEHZSmglk2g,1329
7
- abstract_webtools-0.1.4.11.dist-info/LICENSE,sha256=g3WEJFiVS27HyCGRTwKSsMLyciMaGFdWcZGOe1QalZk,3877
8
- abstract_webtools-0.1.4.11.dist-info/METADATA,sha256=J4bMxDOSB4x6ushMmQoQEm4b997HEMC90uRQfRqCoPQ,8963
9
- abstract_webtools-0.1.4.11.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
10
- abstract_webtools-0.1.4.11.dist-info/top_level.txt,sha256=2DMJ7RmjTcjCsa-uwAV0K6eXXlIIkFDEjBLg_uyCmCI,18
11
- abstract_webtools-0.1.4.11.dist-info/RECORD,,
7
+ abstract_webtools-0.1.4.12.dist-info/LICENSE,sha256=g3WEJFiVS27HyCGRTwKSsMLyciMaGFdWcZGOe1QalZk,3877
8
+ abstract_webtools-0.1.4.12.dist-info/METADATA,sha256=d4kh-bQrfhjqlmyDnxiyoGbm7xAvsVR7ot5yOmiMcNY,8963
9
+ abstract_webtools-0.1.4.12.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
10
+ abstract_webtools-0.1.4.12.dist-info/top_level.txt,sha256=2DMJ7RmjTcjCsa-uwAV0K6eXXlIIkFDEjBLg_uyCmCI,18
11
+ abstract_webtools-0.1.4.12.dist-info/RECORD,,