From d667b1ea8feecb735343d5a5e6f190ecef007f82 Mon Sep 17 00:00:00 2001 From: Tridib Roy Arjo <63996665+arjOman@users.noreply.github.com> Date: Tue, 26 Mar 2024 06:02:50 +0600 Subject: [PATCH] docs: Update async_chromium.ipynb (#19514) In Jupyter, asyncio would throw an error before `.load()` unless `nest_asyncio` is applied (Issue #8494 mentioned this) +Minor typo fixes.. --- .../document_loaders/async_chromium.ipynb | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/docs/docs/integrations/document_loaders/async_chromium.ipynb b/docs/docs/integrations/document_loaders/async_chromium.ipynb index 29187295c9f..616dea0c9d2 100644 --- a/docs/docs/integrations/document_loaders/async_chromium.ipynb +++ b/docs/docs/integrations/document_loaders/async_chromium.ipynb @@ -13,7 +13,7 @@ "\n", "Headless mode means that the browser is running without a graphical user interface.\n", "\n", - "`AsyncChromiumLoader` load the page, and then we use `Html2TextTransformer` to trasnform to text." + "`AsyncChromiumLoader` loads the page, and then we use `Html2TextTransformer` to transform to text." ] }, { @@ -24,7 +24,7 @@ "outputs": [], "source": [ "%pip install --upgrade --quiet playwright beautifulsoup4\n", - "! playwright install" + "!playwright install" ] }, { @@ -53,6 +53,27 @@ "docs[0].page_content[0:100]" ] }, + { + "cell_type": "markdown", + "id": "c64e7df9", + "metadata": {}, + "source": [ + "If you are using Jupyter notebooks, you might need to apply `nest_asyncio` before loading the documents." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5f2fe3c0", + "metadata": {}, + "outputs": [], + "source": [ + "!pip install nest-asyncio\n", + "import nest_asyncio\n", + "\n", + "nest_asyncio.apply()" + ] + }, { "cell_type": "code", "execution_count": 6,