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

Matching two lines of HTML code with a web page's code? [closed]

Asked by 8 years ago

This question already has an answer here:

Why is my code not grabbing text off a webpage?

I am using rprxoy to get the date when a player joined ROBLOX, but it seems Lua can't match two lines of HTML code next to each other to the page's code.

This is the code that isn't working:

--  I haven't included some of the other variables in this piece of code
local link = "http://rproxy.pw/users/" ..id.. "/profile"
------------------------------ important v
local cut = [[<p class="stat-title">Join Date</p><p class="rbx-lead">%.+</p>]] -- the code I am searching for
------------------------------ important ^
local html
local success,msg = pcall(function() html = serv:GetAsync(link,false) end)
if success then 
    print("works")
    local find = html:match(cut)
    if find then
        print("found")
        return find
    else
        return "Cannot Get Join Date"
    end
else
    return "Cannot Get Join Date"
end

So how would I do this? Info on the profile page often has the same lines of code, with the only difference between them being located in the %.+ I have included in the cut variable.

NOTE TO MODS: I have seen a question like this before, but I can't find it again :/

0
Are you getting any output? GullibleChapV2 155 — 8y
0
No, but the function is returning "Cannot Get Join Date", which means the match() returned nil. TheDeadlyPanther 2460 — 8y
0
Well I'm not one to use the HttpService often, so I'm afraid I'm the wrong guy to help you. GullibleChapV2 155 — 8y
0
Damn, nvm. TheDeadlyPanther 2460 — 8y

Marked as Duplicate by BlueTaslem

This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.

Why was this question closed?