community[minor]: allow enabling proxy in aiohttp session in AsyncHTML (#19499)

Allow enabling proxy in aiohttp session async html
This commit is contained in:
Sihan Chen
2024-05-23 02:25:06 +08:00
committed by GitHub
parent 36813d2f00
commit 1f81277b9b
3 changed files with 20 additions and 2 deletions

View File

@@ -37,6 +37,10 @@
"source": [
"urls = [\"https://www.espn.com\", \"https://lilianweng.github.io/posts/2023-06-23-agent/\"]\n",
"loader = AsyncHtmlLoader(urls)\n",
"# If you need to use the proxy to make web requests, for example using http_proxy/https_proxy environmental variables,\n",
"# please set trust_env=True explicitly here as follows:\n",
"# loader = AsyncHtmlLoader(urls, trust_env=True)\n",
"# Otherwise, loader.load() may stuck becuase aiohttp session does not recognize the proxy by default\n",
"docs = loader.load()"
]
},