IPIPGO ip proxy http proxy ip settings: Python/crawler/Android/iOS multi-configuration

http proxy ip settings: Python/crawler/Android/iOS multi-configuration

手把手教你玩转代理IP设置 搞数据采集的朋友都知道,代理IP就是咱们的隐身斗篷。今天就拿ipipgo家的代理服务举例,教大家在不同设备上怎么穿好这件隐身衣。注意看操作细节,有些坑我都帮你们踩过了。 Python…

http proxy ip settings: Python/crawler/Android/iOS multi-configuration

Teach you to play around with proxy IP settings.

搞数据采集的朋友都知道,代理IP就是咱们的隐身斗篷。今天就拿ipipgo家的代理服务举例,教大家在不同设备上怎么穿好这件隐身衣。注意看操作细节,有些坑我都帮你们踩过了。

Python老司机必备设置

先说最常见的requests库配置,记住这个万能模板:


import requests

proxies = {
    'http': 'http://用户名:密码@gateway.ipipgo.com:端口',
    'https': 'http://用户名:密码@gateway.ipipgo.com:端口'
}

response = requests.get('destination URL', proxies=proxies, timeout=10)

Here's one.lesson learned through blood and tears:用动态住宅IP时,记得在账号后面加”/session”参数,这样每次请求都会换IP。比如用户名改成”user123-session”,系统就会自动轮转IP池。

爬虫专用配置技巧

搞Scrapy的朋友看这里,在settings.py里加这几行:


DOWNLOADER_MIDDLEWARES = {
    'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware': 400,
}

IPIPGO_PROXY = "http://账号:密码@gateway.ipipgo.com:端口"

建议用他们的Static Residential IP Package做长期采集任务,IP存活时间能到24小时。实测采集某电商平台商品数据,连续跑三天没触发反爬。

安卓手机配置攻略

现在教大家在手机上设置(以小米手机为例):

  1. 长按已连接的WiFi网络→修改网络
  2. 高级选项里选手动代理
  3. 主机名填gateway.ipipgo.com,端口填购买时给的数字
  4. 用户名密码填账户信息

注意!安卓10以上的系统需要额外操作:到设置→连接→更多连接设置→代理,这里要再确认一次配置。有时候系统更新会重置代理设置,建议每周检查。

苹果设备配置指南

iOS设置更简单但有个坑:


let configuration = URLSessionConfiguration.default
configuration.connectionProxyDictionary = [
    kCFProxyTypeKey: kCFProxyTypeHTTP,
    kCFProxyHostNameKey: "gateway.ipipgo.com",
    kCFProxyPortKey: 端口号,
    kCFProxyUsernameKey: "账号",
    kCFProxyPasswordKey: "密码"
]

用Swift开发的话记得强制类型转换,不然会报类型错误。实测Xcode 15环境下,SOCKS5协议比HTTP协议成功率高出30%,建议在ipipgo后台切换协议类型。

Frequently Asked Questions First Aid Kit

Q: Why can't I connect to the IP I just bought?
A:先检查白名单设置,在ipipgo后台把本机IP加白名单。如果是动态IP,可能需要等5-10分钟生效。

Q: What should I do if the acquisition speed suddenly slows down?
A:八成是IP池用太狠了。动态住宅套餐建议控制每秒请求不超过3次,企业版可以提到10次。在代码里加随机延迟是个好习惯。

Q: What if I need to use multiple country IPs at the same time?
A:在代理地址最后加国家代码,比如gateway.ipipgo.com?country=us。支持220多个国家地区,城市定位要联系客服开通。

Package Selection Tips

根据实测经验给个推荐:

Business Type Recommended Packages finesse
Short-term data collection Dynamic residential (standard) 设置IP存活时间5分钟
Long-term monitoring Static homes Bundled with fixed city + carrier
High Concurrency Operations Dynamic Residential (Business) Enable Smart Routing Optimization

最后说个冷知识:ipipgo的代理服务器支持流量预充值,月底用不完的流量可以结转到下个月。这个在后台设置里要手动开启,默认是不结转的。

This article was originally published or organized by ipipgo.https://www.ipipgo.com/en-us/ipdaili/46624.html

business scenario

Discover more professional services solutions

💡 Click on the button for more details on specialized services

New 10W+ U.S. Dynamic IPs Year-End Sale

Professional foreign proxy ip service provider-IPIPGO

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact Us

13260757327

Online Inquiry. QQ chat

E-mail: hai.liu@xiaoxitech.com

Working hours: Monday to Friday, 9:30-18:30, holidays off
Follow WeChat
Follow us on WeChat

Follow us on WeChat

Back to top
en_USEnglish