Integrations / AI and automation
Use Proxys with LangChain
Load web pages through Proxys in LangChain.
Steps
- Pass proxies to the loader's requests settings.
from langchain_community.document_loaders import WebBaseLoader
proxy = "http://USERNAME-country-us:PASSWORD@gw.proxys.co:8000"
loader = WebBaseLoader("https://example.com", proxies={"http": proxy, "https": proxy})
docs = loader.load()Before you start
Replace USERNAME and PASSWORD with a sub-user's credentials from the dashboard. Change -country-us to the country you need, or remove it for a random location. See targeting options for city, ASN and sticky sessions.