title: how to use cheerio from a browser
body: <p>I am new to JavaScript and am pretty sure I am missing something fundamental in using JSfrom a HTML page (to be browsed by a web browser). </p>
  
  <p>My goal is to scrap photo links from <a href="https://outbox.eait.uq.edu.au/uqczhan2/Photos/" rel="noreferrer">a dynamic website</a> using cheerio and display them in a js gadget (e.g., using <a href="http://sachinchoolur.github.io/lightslider/" rel="noreferrer">lightslider</a>), it looks quite successful <a href="https://www.digitalocean.com/community/tutorials/how-to-use-node-js-request-and-cheerio-to-set-up-simple-web-scraping" rel="noreferrer">following this tutorial</a> to obtain the following script and run it by simply <strong>nodejs scrapt.js</strong> in a bash terminal:</p>
  
  <pre><code>var request = require('request');
  var cheerio = require('cheerio');
  request('https://outbox.eait.uq.edu.au/uqczhan2/Photos/', function (error, respo
    if (!error &amp;&amp; response.statusCode == 200) {
      console.log(html);
    }
  });
  </code></pre>
  
  <p>But now I am not able to run this script in a general webbrowser (by pressing f12 -> console), as error shows after the first syntax:</p>
  
  <pre><code>&gt;var request = require('request');
  VM85:1 Uncaught ReferenceError: require is not defined
      at &lt;anonymous&gt;:1:15
  </code></pre>
  
  <p>I understood some JavaScript modules is required to be loaded before using them, for example for d3.js. i need to run:</p>
  
  <pre><code>&lt;script src="https://d3js.org/d3.v4.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>to use all the d3 function. how should I achieve the same thing that would allow me to use cheerio in a web browser?</p>