PinguProxy
PinguProxy
  • 价格
  • 博客
登录立即开始

联系我们

info@pinguproxy.com
所有系统运行正常

法律信息

  • 隐私政策
  • Cookie 政策

资源

  • 免费工具
  • 集成
  • 代理地区
  • 对比

关注我们

XXTelegramTelegramDiscordDiscordInstagramInstagram

支付方式

StripeStripe
Credit & Debit CardsSatispayRevolut Pay
© 2026 PinguProxy. 保留所有权利。 P.IVA: 02776330397
立即开始1 天试用 · 几秒钟即可创建账户
    返回博客

    此文章目前仅提供英文版本。

    阅读英文版本
    Tutorialpythoncoding2 分钟阅读

    Using Python requests in 2025

    IA
    Iacopo Bonandi
    2025年1月17日 22:30:00

    🐍 Introduction

    When working with proxies, Python's requests library is a go-to solution for sending HTTP requests efficiently. In this tutorial, we'll explore how to send a request to your endpoint and check if your proxy is working. Let's dive deeper into proxy usage together!


    💻 Setting Up Your Proxy Configuration

    To get started, you need to configure your proxy settings. Follow these step-by-step instructions:

    Step 1: Gather Your Proxy Credentials

    After purchasing a plan on PinguProxy, you’ll find your unique credentials in the dashboard.

    • Username: Your proxy username
    • Password: Your proxy password
    • Proxy IP: The proxy server IP address
    • Proxy Port: The port for the proxy server

    Step 2: Install the requests Library

    Ensure your Python environment has the requests library installed. You can install it by running the following command:

    pip install requests
    

    Step 3: Write the Python Script

    Here’s how to configure and test your proxy with Python:

    import requests
    
    # Step 3.1: Proxy credentials (replace with your values)
    USERNAME = "PROXY_USERNAME"
    PASSWORD = "PROXY_PASSWORD"
    PROXY_IP = "PROXY_IP"
    PROXY_PORT = "PROXY_PORT"
    
    # Step 3.2: Configure proxies
    proxies = {
        "http": f"http://{USERNAME}:{PASSWORD}@{PROXY_IP}:{PROXY_PORT}",
        "https": f"http://{USERNAME}:{PASSWORD}@{PROXY_IP}:{PROXY_PORT}",
    }
    
    # Step 3.3: Define the endpoint
    url = "https://pinguproxy.com/ip"
    
    try:
        # Step 3.4: Send a GET request through the proxy
        response = requests.get(url, proxies=proxies, timeout=10)
        response.raise_for_status()  # Raise an error for bad responses
        print("Your IP Address:", response.text)
    except requests.exceptions.RequestException as e:
        print(f"An error occurred: {e}")
    

    Step 4: Test Your Proxy

    Run the script to verify your proxy configuration. If everything is set up correctly, the endpoint will return the IP address seen by the server, confirming that your proxy works.

    Expected Output

    If the proxy is functional, you’ll see something like this:

    Your IP Address: xxxx:xxxx:xxxx:xxxx::
    

    If there’s an issue, an error message will appear:

    An error occurred: HTTPSConnectionPool(host='pinguproxy.com', port=443): Max retries exceeded with url: /ip (Caused by ProxyError('Cannot connect to proxy'))
    

    🚀 Ready to Get Started?

    You’re now ready to harness the power of PinguProxy! If you have questions or need assistance, our support team is available 24/7 at info@pinguproxy.com.

    🐧 Try PinguProxy today and experience the difference!

    Get Started Now


    📚 Useful Resources

    • Contact Support
    • PinguProxy Dashboard

    Thank you for choosing PinguProxy. Your success is our mission! 💙

    编辑标准

    最后更新:2025年3月5日

    PinguProxy 的文章由我们的技术团队撰写和审核。我们不发布付费内容,推荐内容反映产品在负载下的真实表现。发现事实错误或想深入了解?请发送邮件至 info@pinguproxy.com — 我们将更新文章并注明更正。

    通过以下方式联系我们的团队 联系我们.

    相关阅读

    用例Web Scraping用例Data for AI用例SERP Monitoring核心页面Compare proxy types (datacenter, mobile, residential, TOR)核心页面PinguProxy plans & pricing核心页面Free proxy & network tools (IP lookup, header checker, UA parser)核心页面Proxy setup guides for Python, Scrapy, Playwright, and more核心页面Residential proxies by country核心页面PinguProxy vs Bright Data, Oxylabs, and other providers