MCPcopy
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / scrape

Function scrape

scrapegraphai/integrations/scrapegraph_py_compat.py:80–93  ·  view source on GitHub ↗

Call the scrapegraph-py scrape endpoint across SDK versions.

(api_key: Optional[str], url: str)

Source from the content-addressed store, hash-verified

78
79
80def scrape(api_key: Optional[str], url: str) -> dict:
81 """Call the scrapegraph-py scrape endpoint across SDK versions."""
82 api = _detect_api()
83
84 if api == "v3":
85 from scrapegraph_py import ScrapeGraphAI, ScrapeRequest
86
87 with ScrapeGraphAI(api_key=api_key) as client:
88 return _unwrap_result(client.scrape(ScrapeRequest(url=url)))
89
90 from scrapegraph_py import Client
91
92 with Client(api_key=api_key) as client:
93 return client.scrape(url=url)
94
95
96def search(api_key: Optional[str], query: str) -> dict:

Callers

nothing calls this directly

Calls 3

_detect_apiFunction · 0.85
_unwrap_resultFunction · 0.85
scrapeMethod · 0.80

Tested by

no test coverage detected