I want my Discord Bot to be able to visit a website and read its source code so that it can search for specific fields and store their info to variables and eventually relay that information to the room.
<tr id="troop_6170" class="troop-row" data-id="6170" data-name="Abynissia">
In the sample above, it would search for "data-name" and store "Abynissia" in a variable, along with other information, but only one example is necessary.
I have found a few sites that have explained how to at least start, but when I test the bot, it's not recognizing
var ws = new XMLHttpRequest();
It returns an error that XMLHttpRequest is not defined. None of the sites where I found this information explain whether or not there's something else that I'm supposed to have installed, nor do they show any previous code that might explain how to define XMLHttpRequest()
Thank you.