Skip to main content

What is Nightmare.js?

Nightmare.js is a high-level browser automation library built on Electron. It provides a simple “human-readable” API to interact with pages. Oculus Proxies are necessary to bypass “Per-IP” session limits on dynamic sites where the site tracks how many accounts or searches are active from a single connection.
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.

How to Use Oculus Proxies With Nightmare.js

1

Install package

Install via cmd:
npm install nightmare
2

Example code

Use the following code as an example for Nightmare.js. Make sure to replace the correct proxy credentials from your dashboard inside nightmare.
const Nightmare = require('nightmare');

const nightmare = Nightmare({
  switches: { 'proxy-server': 'proxy.oculus-proxy.com:PORT' }
});

nightmare
  .authenticate('USERNAME', 'PASSWORD')
  .goto('http://httpbin.org/ip')
  .evaluate(() => document.body.innerText)
  .end()
  .then(console.log);