Jump to content
UBot Underground

In Compiled Bot - Search for text string


Recommended Posts

ex. Firefox allows you to press ctr + f to open up a search box. This highlight the text in the window if found.

 

Is there a way to do that with ubot? I dont need a shortcut combination, but a way to do this would be great.

 

This is in ubot 4.

Link to post
Share on other sites

Well the browser shows HTML code.

If you want to highlight something, you can change the HTML code. 

 

So you basically search the html code for the information you want. And then add some html tags to highlight that area with yellow for example.

Not sure if there is a way to navigate to that position as well. But that might be possible with javascript.

 

There are not native functions in ubot to do that. So the only way I know is to work with the HTML results directly.

Dan

Link to post
Share on other sites

Well the browser shows HTML code.

If you want to highlight something, you can change the HTML code. 

 

So you basically search the html code for the information you want. And then add some html tags to highlight that area with yellow for example.

Not sure if there is a way to navigate to that position as well. But that might be possible with javascript.

 

There are not native functions in ubot to do that. So the only way I know is to work with the HTML results directly.

Dan

 

Try the focus command to navigate to that position.

Marton

Link to post
Share on other sites

The focus command also forces the entire page to scroll down to the selected element.

 

http://wiki.ubotstudio.com/wiki/Focus

Argh you are right. Sorry.

 

I did a quick test and it wasn't working. But now it does. Not sure what I've messed up  :rolleyes:

Link to post
Share on other sites

Argh you are right. Sorry.

 

I did a quick test and it wasn't working. But now it does. Not sure what I've messed up  :rolleyes:

 

Actually I did a quick test myself, and it doesn't scroll down for me when the selected element's attribute is "innertext". Did it work for you? It seems to work for other attributes though.

Link to post
Share on other sites

450

play with this

 

load html("<!DOCTYPE html>
<html>
<head>
<script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>
</head>

<body>
<h2>This is a heading</h2>
<p style=\"background-color:#ff0000\">This is a paragraph.</p>
<p style=\"background-color:#00ff00\">This is a paragraph.</p>
<p style=\"background-color:#0000ff\">This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
</html>
")
set(#A"<!DOCTYPE html>
<html>
<head>
<script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"></script>
</head>

<body>
<h2>This is a heading</h2>
<p style=\"background-color:#ff0000\">This is a paragraph.</p>
<p style=\"background-color:#00ff00\">This is a paragraph.</p>
<p style=\"background-color:#0000ff\">This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
</html>
""Global")
set(#replace$replace regular expression(#A"paragraph""<span1>paragraph</span1>"), "Global")
load html(#replace)
run javascript("$(\"span1\").css(\"background-color\",\"yellow\");")

 

 

TC

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