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..
This commit is contained in:
Tridib Roy Arjo 2024-03-26 06:02:50 +06:00 committed by GitHub
parent 5b6b1f9e1d
commit d667b1ea8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,