Beautifulsoup 代理集成
本指南可能已过时。如需最新指南,请参阅 我们的文档。
支持支付宝等多种支付方式
- 超15000万 住宅 IP
- 可保持粘性和轮换的会话
- 99.95% 成功率
- 地理位置定位 - 免费
Beautifulsoup 与 Bright Data 的代理集成
- 首先,前往你的 Bright Data 控制面板 并点击“创建一个 Zone”。
- 选择“网络类型”并点击保存。
- 在 Beautifulsoup 中填写“proxy-server”值中的“Proxy IP:Port”,例如 brd.superproxy.io:22225。
- 在“page.authenticate”下输入你的 Bright Data 账户 ID 和代理 Zone 名称在“username”值中,例如: brd-customer-CUSTOMER-zone-YOURZONE 以及在 Zone 设置中找到的 Zone 密码。
- 例如:
from bs4 import BeautifulSoup
import requests
import json
proxies = {
'http': 'http://brd-customer-[ACCOUNT_ID]-zone-[ZONE_NAME]:[ZONE_PASSWORD]@brd.superproxy.io:22225',
'https': 'http://brd-customer-[ACCOUNT_ID]-zone-[ZONE_NAME]:[ZONE_PASSWORD]@brd.superproxy.io:22225',
}
url = "http://lumtest.com/myip.json"
res = requests.get(url, proxies=proxies, verify=False)
res.raise_for_status()
res_body = res.text
soup = BeautifulSoup(res_body, "html.parser")
html_content = str(soup)
data = {
"IP": html_content,
}
print(json.dumps(data, indent=4))
代理管理器和 Beautifulsoup 集成
- 首先,前往你的 Bright Data 控制面板 并点击“创建一个 Zone”。
- 选择“网络类型”并点击保存。
- 在 Beautifulsoup 中填写“proxy-server”值中的“Proxy IP:Port”,例如 brd.superproxy.io:22225。
- 在“page.authenticate”下输入你的 Bright Data 账户 ID 和代理 Zone 名称在“username”值中,例如: brd-customer-CUSTOMER-zone-YOURZONE 以及在 Zone 设置中找到的 Zone 密码。
- 例如:
from bs4 import BeautifulSoup
import requests
import json
proxies = {
'http': 'http://brd-customer-[ACCOUNT_ID]-zone-[ZONE_NAME]:[ZONE_PASSWORD]@brd.superproxy.io:22225',
'https': 'http://brd-customer-[ACCOUNT_ID]-zone-[ZONE_NAME]:[ZONE_PASSWORD]@brd.superproxy.io:22225',
}
url = "http://lumtest.com/myip.json"
res = requests.get(url, proxies=proxies, verify=False)
res.raise_for_status()
res_body = res.text
soup = BeautifulSoup(res_body, "html.parser")
html_content = str(soup)
data = {
"IP": html_content,
}
print(json.dumps(data, indent=4))
获取Beautifulsoup代理
由一项屡获殊荣的代理基础架构提供支持
凭借超过 15000万 住宅 IP、行业领先的技术,以及可定位任意国家、城市、邮政编码、运营商和 ASN 的能力,我们高端的代理服务成为开发者的首选。
代理网络定价
我们接受这些支付方式:
在代理和数据收集行业中领先者
650TB的公共数据每天收集
每天发布新功能
服务于世界7/10大的顶尖大学
4.6/5 Trustpilot评分
行业内优秀的客户体验
您提需求,我们开发
每天发布新功能
24/7全球支持
在您需要时回答任何问题
完全透明
实时网络性能仪表板
专属客户经理
优化您的性能
量身定制的解决方案
满足您的数据收集目标