Website Reader

Parameters and methods of WebsiteReader, which crawls websites and reads pages into documents.

WebsiteReader reads data from websites.

Parameters

ParameterTypeDefaultDescription
chunking_strategyOptional[ChunkingStrategy]FixedSizeChunking()Strategy used to chunk documents
max_depthint3Maximum depth level for crawling links
max_linksint10Maximum number of links to crawl
timeoutint10Request timeout in seconds
proxyOptional[str]NoneProxy URL used for requests
allowed_hostsOptional[List[str]]NoneHostnames the reader is allowed to fetch from. See Restricting URL Fetches.

WebsiteReader also accepts the base Reader constructor parameters.

Methods

read()

Crawls a website starting from the given URL and returns a list of documents.

ParameterTypeDefaultDescription
urlstrRequiredURL of the website to crawl and read
nameOptional[str]NoneName override for the resulting documents

async_read()

Async variant of read(). Accepts the same parameters.