Jump to content
UBot Underground

Recommended Posts

Hey there,

The other day I was migrating a bot from ui html panel to the browser (Small interface). I had to push the contents of a table with multiple rows and columns to a JS variable in the browser. 

Thats where my problems started. Spent whole night debugging and wondering whats the problem turning the whole bot upside down, you know the thrill.Funny stuff because the whole problem was because of a single character.

 

Ubot &table puts a strange new line character and Javascript does not like that character.

navigate("http://www.tutorialspoint.com/html/html_tables.htm","Wait")
scrape table(<(tagname="table" AND style="border-collapse: separate; border-spacing: 1px;")>,&asd)
set(#test,&asd,"Global")
run javascript("var test = {#test};")
alert($eval("test;"))

The above one will not work.. Even if you do
 

set(#test,$replace(#test,$new line,""),"Global")

Can somebody help me to
&table content -> #ubot variable -> JS var

 

Thanks,

Todor.

 

 

 

Link to post
Share on other sites

try

navigate("http://www.tutorialspoint.com/html/html_tables.htm","Wait")
scrape table(<(tagname="table" AND style="border-collapse: separate; border-spacing: 1px;")>,&asd)
set(#test,&asd,"Global")
alert($eval("var a = {$ConverToJavascriptValue(#test)};
a;"))
define $ConverToJavascriptValue(#_data) {
    set(#_dataOut,$replace(#_data,"\"","\\\""),"Global")
    set(#_dataOut,$replace regular expression(#_dataOut,"(\\r\\n|\\n)","\\r\\n"),"Global")
    set(#_dataOut,"\"{#_dataOut}\"","Global")
    return(#_dataOut)
}
  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...