The issue is that the tutorial is being run in Node, and you’re trying to put your scraping code into client.js, which runs in the browser. require() is built into Node, which is how we run your server-side code in Glitch. You should be able to get this to work by moving your code to server.js. Then your scraping code will run, and you can use console.log() to print messages that will appear in the Glitch logs.
You could just add your scraping code at the bottom of server.js, and then the scraping will happen every time the server is restarted. This is the easiest thing to do, and probably where you should start. Any time you change the code in server.js, the server is restarted, and your code will run again.
The other way to go would be to add your code to a route handling function, and then you would be able to cause the scraping to happen by hitting the server from a browser, and you could add some code to return the results to the browser.