Advertisement
dereksir

Untitled

Apr 21st, 2024
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // import the required module
  2. import got from 'got';
  3.  
  4. const url = 'https://www.g2.com/products/visual-studio/reviews';
  5. const apikey = '<YOUR_ZENROWS_API_KEY>';
  6.  
  7. (async () => {
  8.     try {
  9.         const {body} = await got('https://api.zenrows.com/v1/', {
  10.             searchParams: {
  11.                 url: url,
  12.                 apikey: apikey,
  13.                 js_render: 'true',
  14.                 premium_proxy: 'true',
  15.             }
  16.         });
  17.         console.log(body);
  18.     } catch (error) {
  19.         console.error('Error:', error.response.body);
  20.     }
  21. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement