BS4HTMLParser#

class langchain_community.document_loaders.parsers.html.bs4.BS4HTMLParser(*, features: str = 'lxml', get_text_separator: str = '', **kwargs: Any)[source]#

Parse HTML files using Beautiful Soup.

Initialize a bs4 based HTML parser.

Methods

__init__(*[,ย features,ย get_text_separator])

Initialize a bs4 based HTML parser.

lazy_parse(blob)

Load HTML document into document objects.

parse(blob)

Eagerly parse the blob into a document or documents.

Parameters:
  • features (str)

  • get_text_separator (str)

  • kwargs (Any)

__init__(*, features: str = 'lxml', get_text_separator: str = '', **kwargs: Any) โ†’ None[source]#

Initialize a bs4 based HTML parser.

Parameters:
  • features (str)

  • get_text_separator (str)

  • kwargs (Any)

Return type:

None

lazy_parse(blob: Blob) โ†’ Iterator[Document][source]#

Load HTML document into document objects.

Parameters:

blob (Blob)

Return type:

Iterator[Document]

parse(blob: Blob) โ†’ list[Document]#

Eagerly parse the blob into a document or documents.

This is a convenience method for interactive development environment.

Production applications should favor the lazy_parse method instead.

Subclasses should generally not over-ride this parse method.

Parameters:

blob (Blob) โ€“ Blob instance

Returns:

List of documents

Return type:

list[Document]