ScrapingAntLoader#
- class langchain_community.document_loaders.scrapingant.ScrapingAntLoader(urls: List[str], *, api_key: str | None = None, scrape_config: dict | None = None, continue_on_failure: bool = True)[source]#
Turn an url to LLM accessible markdown with ScrapingAnt.
For further details, visit: https://docs.scrapingant.com/python-client
Initialize client.
- Parameters:
urls (List[str]) β List of urls to scrape.
api_key (str | None) β The ScrapingAnt API key. If not specified must have env var SCRAPINGANT_API_KEY set.
scrape_config (dict | None) β The scraping config from ScrapingAntClient.markdown_request
continue_on_failure (bool) β Whether to continue if scraping an url fails.
Methods
__init__
(urls,Β *[,Β api_key,Β scrape_config,Β ...])Initialize client.
A lazy loader for Documents.
aload
()Load data into Document objects.
Fetch data from ScrapingAnt.
load
()Load data into Document objects.
load_and_split
([text_splitter])Load Documents and split into chunks.
- __init__(urls: List[str], *, api_key: str | None = None, scrape_config: dict | None = None, continue_on_failure: bool = True) None [source]#
Initialize client.
- Parameters:
urls (List[str]) β List of urls to scrape.
api_key (str | None) β The ScrapingAnt API key. If not specified must have env var SCRAPINGANT_API_KEY set.
scrape_config (dict | None) β The scraping config from ScrapingAntClient.markdown_request
continue_on_failure (bool) β Whether to continue if scraping an url fails.
- Return type:
None
- async alazy_load() AsyncIterator[Document] #
A lazy loader for Documents.
- Return type:
AsyncIterator[Document]
- lazy_load() Iterator[Document] [source]#
Fetch data from ScrapingAnt.
- Return type:
Iterator[Document]
- load_and_split(text_splitter: TextSplitter | None = None) list[Document] #
Load Documents and split into chunks. Chunks are returned as Documents.
Do not override this method. It should be considered to be deprecated!
- Parameters:
text_splitter (Optional[TextSplitter]) β TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.
- Returns:
List of Documents.
- Return type:
list[Document]
Examples using ScrapingAntLoader