Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersBeautiful SoupGoogle Cloud Document AIDoctran: extract propertiesDoctran: interrogate documentsDoctran: language translationHTML to textNucliaOpenAI metadata taggerText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryCallbacksChat loadersComponentsDocument transformersHTML to textHTML to texthtml2text is a Python package that converts a page of HTML into clean, easy-to-read plain ASCII text. The ASCII also happens to be a valid Markdown (a text-to-HTML format).pip install html2textfrom langchain.document_loaders import AsyncHtmlLoaderurls = ["https://www.espn.com", "https://lilianweng.github.io/posts/2023-06-23-agent/"]loader = AsyncHtmlLoader(urls)docs = loader.load()    Fetching pages: 100%|############| 2/2 [00:00<00:00, 10.75it/s]from langchain.document_transformers import Html2TextTransformerurls = ["https://www.espn.com", "https://lilianweng.github.io/posts/2023-06-23-agent/"]html2text = Html2TextTransformer()docs_transformed = html2text.transform_documents(docs)docs_transformed[0].page_content[1000:2000]    "  * ESPNFC\n\n  * X Games\n\n  * SEC Network\n\n## ESPN Apps\n\n  * ESPN\n\n  * ESPN Fantasy\n\n## Follow ESPN\n\n  * Facebook\n\n  * Twitter\n\n  * Instagram\n\n  * Snapchat\n\n  * YouTube\n\n  * The ESPN Daily Podcast\n\n2023 FIFA Women's World Cup\n\n## Follow live: Canada takes on Nigeria in group stage of Women's World Cup\n\n2m\n\nEPA/Morgan Hancock\n\n## TOP HEADLINES\n\n  * Snyder fined $60M over findings in investigation\n  * NFL owners approve $6.05B sale of Commanders\n  * Jags assistant comes out as gay in NFL milestone\n  * O's alone atop East after topping slumping Rays\n  * ACC's Phillips: Never condoned hazing at NU\n\n  * Vikings WR Addison cited for driving 140 mph\n  * 'Taking his time':
html2text is a Python package that converts a page of HTML into clean, easy-to-read plain ASCII text.
html2text is a Python package that converts a page of HTML into clean, easy-to-read plain ASCII text. ->: Skip to main contentü¶úÔ∏èüîó LangChainDocsUse casesIntegrationsAPICommunityChat our docsLangSmithJS/TS DocsSearchCTRLKProvidersAnthropicAWSGoogleMicrosoftOpenAIMoreComponentsLLMsChat modelsDocument loadersDocument transformersBeautiful SoupGoogle Cloud Document AIDoctran: extract propertiesDoctran: interrogate documentsDoctran: language translationHTML to textNucliaOpenAI metadata taggerText embedding modelsVector storesRetrieversToolsAgents and toolkitsMemoryCallbacksChat loadersComponentsDocument transformersHTML to textHTML to texthtml2text is a Python package that converts a page of HTML into clean, easy-to-read plain ASCII text. The ASCII also happens to be a valid Markdown (a text-to-HTML format).pip install html2textfrom langchain.document_loaders import AsyncHtmlLoaderurls = ["https://www.espn.com", "https://lilianweng.github.io/posts/2023-06-23-agent/"]loader = AsyncHtmlLoader(urls)docs = loader.load()    Fetching pages: 100%|############| 2/2 [00:00<00:00, 10.75it/s]from langchain.document_transformers import Html2TextTransformerurls = ["https://www.espn.com", "https://lilianweng.github.io/posts/2023-06-23-agent/"]html2text = Html2TextTransformer()docs_transformed = html2text.transform_documents(docs)docs_transformed[0].page_content[1000:2000]    "  * ESPNFC\n\n  * X Games\n\n  * SEC Network\n\n## ESPN Apps\n\n  * ESPN\n\n  * ESPN Fantasy\n\n## Follow ESPN\n\n  * Facebook\n\n  * Twitter\n\n  * Instagram\n\n  * Snapchat\n\n  * YouTube\n\n  * The ESPN Daily Podcast\n\n2023 FIFA Women's World Cup\n\n## Follow live: Canada takes on Nigeria in group stage of Women's World Cup\n\n2m\n\nEPA/Morgan Hancock\n\n## TOP HEADLINES\n\n  * Snyder fined $60M over findings in investigation\n  * NFL owners approve $6.05B sale of Commanders\n  * Jags assistant comes out as gay in NFL milestone\n  * O's alone atop East after topping slumping Rays\n  * ACC's Phillips: Never condoned hazing at NU\n\n  * Vikings WR Addison cited for driving 140 mph\n  * 'Taking his time':