1111 SearchResponse ,
1212 AsyncSearch ,
1313)
14+ from .helpers import build_path
1415
1516
1617class DNSParams (TypedDict ):
@@ -158,16 +159,6 @@ def ai_scrape(self, params: AIScrapeParams) -> AIScrapeResponse:
158159 ).perform_with_content ()
159160 return resp
160161
161- def scrape (self , params : ScrapeParams ) -> ScrapeResponse :
162- path = "/web/scrape"
163- resp = Request (
164- config = self .config ,
165- path = path ,
166- params = cast (Dict [Any , Any ], params ),
167- verb = "post" ,
168- ).perform_with_content ()
169- return resp
170-
171162 def html_to_any (self , params : HTMLToAnyParams ) -> Any :
172163 path = "/web/html_to_any"
173164 resp = Request (
@@ -179,9 +170,10 @@ def html_to_any(self, params: HTMLToAnyParams) -> Any:
179170 return resp
180171
181172 def dns (self , params : DNSParams ) -> DNSResponse :
182- domain = params .get ("domain" , "" )
183- type = params .get ("type" , "A" )
184- path = f"/web/html_to_any?domain={ domain } &type={ type } "
173+ path = build_path (
174+ base_path = "/web/html_to_any" ,
175+ params = params ,
176+ )
185177 resp = Request (
186178 config = self .config ,
187179 path = path ,
@@ -257,9 +249,10 @@ async def html_to_any(self, params: HTMLToAnyParams) -> Any:
257249 return resp
258250
259251 async def dns (self , params : DNSParams ) -> DNSResponse :
260- domain = params .get ("domain" , "" )
261- type = params .get ("type" , "A" )
262- path = f"/web/html_to_any?domain={ domain } &type={ type } "
252+ path = build_path (
253+ base_path = "/web/html_to_any" ,
254+ params = params ,
255+ )
263256 resp = await AsyncRequest (
264257 config = self .config ,
265258 path = path ,
0 commit comments