> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oculusproxies.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Set Up Oculus Proxies With BeautifulSoup

> Learn how to integrate Oculus Proxies with BeautifulSoup for secure, anonymous, and efficient web scraping. Follow this guide to protect your identity and avoid IP bans while extracting data.

<img src="https://mintcdn.com/oculus/4CVh05wC6-hsrqWV/integration-guides/img/oculus_integrations/BeautifulSoup.png?fit=max&auto=format&n=4CVh05wC6-hsrqWV&q=85&s=415c7c06d43629dacf19ae92a70c65b2" alt="title" width="720" height="200" data-path="integration-guides/img/oculus_integrations/BeautifulSoup.png" />

## What is BeautifulSoup?

**BeautifulSoup** is a widely-used Python library for web scraping that simplifies parsing and navigating HTML and XML documents. It allows developers to locate and extract data efficiently from web pages.

When combined with **Oculus Proxies**, BeautifulSoup enables **anonymous data collection**, allowing you to access geo-restricted content and minimize detection risks while scraping websites at scale.

<Tip>
  If you're using **Oculus** to scrape search engines like **Google, Bing, or Yandex** and facing connection issues, your proxy type may need adjustment. **ISP Premium Proxies** provide stable and unrestricted access, preventing blocks that standard proxies may encounter. Switching to **ISP Premium Proxies** can improve performance.
</Tip>

## How to Integrate Oculus Proxies With BeautifulSoup

<Steps>
  <Step title="Install Required Libraries">
    Before you begin, make sure you have **BeautifulSoup** and **requests** installed. Run the following command in your terminal:

    ```bash theme={null}
    pip install beautifulsoup4 requests  
    ```
  </Step>

  <Step title="Set Up Your Oculus Proxy">
    1. Log in to your [Oculus Dashboard](https://oculusproxies.com/dashboard/page/plans) and retrieve your proxy credentials: **Host, Port, Username, Password.**

    2. Define your proxy settings in Python using the format below:

    ```python theme={null}
    proxy = {  
      "http": "http://[USERNAME]:[PASSWORD]@[HOST]:[PORT]",  
      "https": "http://[USERNAME]:[PASSWORD]@[HOST]:[PORT]"  
    }  
    ```

    Replace `[USERNAME]`, `[PASSWORD]`, `[HOST]`, and `[PORT]` with your actual Oculus Proxy details.
  </Step>

  <Step title="Use the Proxy with Requests and BeautifulSoup">
    Here’s a Python script that integrates **Oculus Proxies** with **BeautifulSoup** to fetch and parse data securely:

    ```python theme={null}
    import requests  
    from bs4 import BeautifulSoup  

    # Proxy setup with authentication  
    proxy = {  
        "http": "http://[USERNAME]:[PASSWORD]@[HOST]:[PORT]",  
        "https": "http://[USERNAME]:[PASSWORD]@[HOST]:[PORT]"  
    }  

    # Target URL to verify the proxy  
    url = "https://httpbin.org/ip"  # Returns the IP address of the request  

    try:  
        # Make the request using the proxy  
        response = requests.get(url, proxies=proxy, timeout=10)  
        response.raise_for_status()  # Raise an error for HTTP issues  

        # Parse the content with BeautifulSoup  
        soup = BeautifulSoup(response.text, "html.parser")  

        # Print the response  
        print("Response Content (IP Address):")  
        print(soup.prettify())  

    except requests.exceptions.RequestException as e:  
        print("Error occurred while using the proxy:", e)  
    ```
  </Step>

  <Step title="Verify Your Proxy Connection">
    If the proxy is working correctly, the script should output a JSON response displaying the **IP address provided by Oculus Proxies**:

    ```json theme={null}
    {  
      "origin": "123.45.67.89"  
    }  
    ```

    This confirms that your Oculus Proxy is successfully routing your requests.
  </Step>
</Steps>

**Congratulations!** You’ve successfully integrated **Oculus Proxies** with **BeautifulSoup**. Now you can perform secure and anonymous web scraping while avoiding IP bans and geo-restrictions. 🚀
