> ## 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 Use Oculus Proxies With JSDOM

> Enhance your data processing workflows by integrating Oculus Proxies with your request library, ensuring JSDOM and Htmlparser2 receive unblocked content to parse.

## What is JSDOM?

**JSDOM** mimics a browser environment, while `Htmlparser2` is a fast HTML/XML parser. They are "data processors" and do not perform network requests themselves. You don't apply proxies to the parser, but you use **Oculus Proxies** to get the data they parse. Without a proxy-enabled request (via Axios/Fetch), the parser would have no content to process because the target site would likely block the initial data fetch.

<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 Use Oculus Proxies With JSDOM

<Steps>
  <Step title="Install package">
    Install via cmd:

    ```
    npm install jsdom htmlparser2 axios
    ```
  </Step>

  <Step title="Example code">
    Use the following code as an example for JSDOM. Make sure to replace the correct proxy credentials from your [dashboard](https://oculusproxies.com/dashboard/) inside `response`.

    ```javascript theme={null}
    const axios = require('axios');
    const { JSDOM } = require('jsdom');

    async function parseWithProxy() {
    // Proxy is used here to fetch the data
    const response = await axios.get('http://httpbin.org/ip', {
        proxy: { 
            host: 'proxy.oculus-proxy.com', 
            port: PORT, 
            auth: { username: 'USERNAME', password: 'PASSWORD' } 
        }
    });

    // The Parser then processes the fetched content
    const dom = new JSDOM(response.data);
    console.log('Parsed Content:', dom.window.document.body.textContent);
    }
    ```
  </Step>
</Steps>
