Jump to content
UBot Underground

Coding Problem. Please help.


Recommended Posts

Please could you help me understand why the following does not work:

 
navigate("http://www.ubotstudio.com/resources""Wait")
wait for browser event("Everything Loaded""")
set(#text$scrape attribute(<tagname="p">"innerhtml"), "Global")
set(#text2$eval("var example = \"{#text}\"; example;"), "Global")
 
For whatever reason, #text2 is always blank.
Link to post
Share on other sites

Text is blank because you are not escaping string that you are passing to JavaScript: http://msdn.microsoft.com/en-us/library/ie/2yfce773(v=vs.94).aspx

 

So here is how you would do it if you need to do it via eval:

set(#text2, $eval("var example = \"{$replace($replace($replace($replace(#text, $new line, "\\n"), "\\", "\\\\"), "\'", "\\\'"), "\"", "\\\"")}\"; example;"), "Global")

FYI, you should also use "wait for element" instead of "wait for browser event".

Link to post
Share on other sites
  • 3 weeks later...

To solve this specific problem with a workaround, why don't you use a simple regex with $document text or something ?

 

p.s.: you don't need to set allow javascript to "Yes", it's on by default

 

Marton

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...