Jump to content



Photo

Weird Issue With &tables

js javascript table issue

  • Please log in to reply
2 replies to this topic

#1 todordonev

todordonev

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 31 posts
  • OS:Windows 8
  • Total Memory:2Gb
  • Framework:v3.5 & v4.0
  • License:Standard Edition

Posted 28 May 2016 - 01:54 AM

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.

 

 

 



#2 pash

pash

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 3517 posts
  • OS:Windows 10
  • Total Memory:More Than 9Gb
  • Framework:v4.5+, unsure
  • License:Developer Edition

Posted 28 May 2016 - 02:13 AM

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)
}

New Plugin:: Advanced Facebook | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint
- Advanced Data Text File | Advanced DateTime | Advanced Dialog | Advanced Document | Advanced Google Blogger V3 | Advanced Google Drive | Advanced Google YouTube V3 | Advanced Image | Advanced Video | Advanced Screen and Windows | Advanced Systems | Advanced Ubot 1 | Advanced Ubot 2 | Advanced WordPress | Advanced Connection | Advanced Twitter | Advanced Email | Advanced PowerPoint

- Advanced Captcha (V3) | Advanced Captcha (V2) (Old) | Create Table From Excel (Lite) | Check Conection | Ubot Enter License | Auto Free Memory
- Working hours GMT+7. i regret sometimes the answer is delayed due to health problems.


#3 todordonev

todordonev

    Advanced Member

  • Fellow UBotter
  • PipPipPip
  • 31 posts
  • OS:Windows 8
  • Total Memory:2Gb
  • Framework:v3.5 & v4.0
  • License:Standard Edition

Posted 29 May 2016 - 02:11 AM

Hey pash, thanks a lot!







Also tagged with one or more of these keywords: js, javascript, table, issue

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users