Advertisement
dereksir

Untitled

Feb 28th, 2024 (edited)
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async function scraper() {
  2.     // select a proxy from the pool
  3.     const proxy = proxyPool[Math.floor(Math.random() * proxyPool.length)];
  4.  
  5.     // set browser options
  6.     const options = new firefox.Options().addArguments('--headless');
  7.  
  8.     // initialize the webdriver
  9.     const driver = new Builder()
  10.         .forBrowser('firefox')
  11.         // add the proxy to the webdriver
  12.         .setProxy(proxy.manual({
  13.             http: proxy,
  14.             https: proxy,
  15.         }))
  16.         .setFirefoxOptions(options)
  17.         .build();
  18. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement