Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

A way to get DOM element properties using Lua?

Asked by
VAHMPIN 277 Moderation Voter
3 years ago
Edited 3 years ago

Ok so, if you don't understand what a DOM element is then i'll explain:

a DOM element is a unique ID used within HTML (usually with .js files) to save values which need to be calculated (such as player value, what i'm trying to get from a site called rolimons) a DOM value is usually represented like id="cool_name", i was wondering if anybody knew how to get the properties / elements of this value (you can get it from the google chrome console) - so i was wondering if there was a lua conversion for this?

Edit: I found this devforum post but can't test out the plugin right now, maybe this plugin could help? POST

Something like this (Probably Doesn't work) :

local HttpService = game:GetService("HttpService")
local WebRequest = HttpService:GetAsync("https://www.rolimons.com/player/1689463945")
local FindDOM = string.find(WebRequest, "$('#player_value')"

print(FindDOM.innerText)

this thread is about getting a HTML DOM (Document Object Model) value through lua, so it's about lua. -- > for a ROBLOX game

0
The DOM elements are created at runtime via javascript. You cannot run javascript in roblox so you can't do that this way. What you can do is see how the javascript grabs the values (most likely a http request), see what api it makes a request to and then use it in your roblox script Amiaa16 3227 — 3y

Answer this question