File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change 1+ import warnings
2+ from functools import wraps
3+
14from requests import Response , Session
25from requests .adapters import HTTPAdapter
36from urllib3 .util import Retry
47
58from .utils import process_headers , process_params
69
10+ def deprecated (reason ):
11+ """Decorator to mark functions as deprecated."""
12+ def decorator (func ):
13+ @wraps (func )
14+ def wrapper (* args , ** kwargs ):
15+ warnings .warn (
16+ f"{ func .__name__ } () is deprecated. { reason } " ,
17+ category = DeprecationWarning ,
18+ stacklevel = 2
19+ )
20+ return func (* args , ** kwargs )
21+ return wrapper
22+ return decorator
23+
724
825class ScrapingBeeClient :
926 # API Endpoints
@@ -59,6 +76,7 @@ def request(
5976 # HTML API (Legacy - WILL BE REMOVED)
6077 # ============================================
6178
79+ @deprecated ("Please use html_api() instead. This method will be removed in version 2.0.0." )
6280 def get (
6381 self ,
6482 url : str ,
@@ -89,6 +107,7 @@ def get(
89107 ** kwargs
90108 )
91109
110+ @deprecated ("Please use html_api() instead. This method will be removed in version 2.0.0." )
92111 def post (
93112 self ,
94113 url : str ,
You can’t perform that action at this time.
0 commit comments