var stuff = $($(r).find(".BuyPriceBox")).find(".PurchaseButton").data();
r is the response from the AJAX call r is the web page response.
I want to write the above code in JavaScript, not using any jQuery, as node.js doesn't allow me to.
I tried document.getElementsByClassName("BuyPriceBox")
but I dont know how to do .find
equivalent and get the data.
Edit, Updated
Here is what i tried
var parser = new DOMParser();
var doc = parser.parseFromString(r, "text/html");
console.log(JSON.stringify(query(doc, ".BuyPriceBox .PurchaseButton").dataset))
Is that correct? because i just got an error : 'TypeError: Cannot read property 'toLowerCase' of undefined'
This is what i have at the top.
var request = require("request");
var DOMParser = require("xmldom").DOMParser; var query = require("queryselector");
also im getting the request like this.
request({ url: "roblox.com/A-Lucky-Presence-item?id=380201576";, method: 'GET' }, function(err, res, r) {
Also, how do i install the modules?