langchain 在WebBaseLoader中获取警告而不是实际信息

fzwojiic  于 3个月前  发布在  其他
关注(0)|答案(1)|浏览(94)

检查其他资源

  • 我为这个问题添加了一个非常描述性的标题。
  • 我在集成搜索中搜索了LangChain文档。
  • 我使用GitHub搜索找到了一个类似的问题,但没有找到。
  • 我确信这是LangChain中的一个bug,而不是我的代码。
  • 通过更新到LangChain的最新稳定版本(或特定集成包)无法解决此bug。

示例代码

from langchain.document_loaders import WebBaseLoader
loader = WebBaseLoader(' [https://m.vk.com/support?category_id=2](https://m.vk.com/support?category_id=2) ')
data = loader.load()
print(data[0])

错误信息和堆栈跟踪(如果适用)

您的浏览器已过期这可能导致VK运行缓慢或出现错误。请更新浏览器或安装以下其中之一:ChromeOperaFirefox

描述

我正在尝试从 "' https://m.vk.com/support "(包括子链接的信息,以构建RAG)。但是看到输出内容为:"Your browser is out of dateThis may cause VK to work slowly or experience errors.Update your browser or install one of the following:ChromeOperaFirefox"

系统信息

langchain==0.2.6
langchain-community==0.2.6
langchain-core==0.2.11
langchain-text-splitters==0.2.2
windows
python 3.10

bwntbbo3

bwntbbo31#

我已经尝试添加UA头,但仍然出现相同的错误。

from langchain_community.document_loaders import WebBaseLoader
loader = WebBaseLoader(' [https://m.vk.com/support?category_id=2](https://m.vk.com/support?category_id=2) ',
 header_template={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36",
 "Sec-Ch-Ua-Mobile":"?0",
 "Sec-Ch-Ua-Platform":"macOS"})
data = loader.load()
print(data)

相关问题