The450Man 0 Posted October 1, 2014 Report Share Posted October 1, 2014 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. Quote Link to post Share on other sites
bigmatt 0 Posted October 3, 2014 Report Share Posted October 3, 2014 I believe there are several better/other ways of searching something on site with ubot, why would you want that? do you need the box itself for it? Quote Link to post Share on other sites
The450Man 0 Posted October 7, 2014 Author Report Share Posted October 7, 2014 yes, a way to highlight the searched for text Quote Link to post Share on other sites
Bot-Factory 602 Posted October 7, 2014 Report Share Posted October 7, 2014 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 Quote Link to post Share on other sites
Marton 48 Posted October 7, 2014 Report Share Posted October 7, 2014 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 Quote Link to post Share on other sites
Bot-Factory 602 Posted October 7, 2014 Report Share Posted October 7, 2014 Try the focus command to navigate to that position.Marton That doesn't scroll down on a page if the text is lower than the actual view. Dan Quote Link to post Share on other sites
Marton 48 Posted October 7, 2014 Report Share Posted October 7, 2014 That doesn't scroll down on a page if the text is lower than the actual view. Dan The focus command also forces the entire page to scroll down to the selected element. http://wiki.ubotstudio.com/wiki/Focus Quote Link to post Share on other sites
Bot-Factory 602 Posted October 7, 2014 Report Share Posted October 7, 2014 The focus command also forces the entire page to scroll down to the selected element. http://wiki.ubotstudio.com/wiki/FocusArgh 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 Quote Link to post Share on other sites
Marton 48 Posted October 7, 2014 Report Share Posted October 7, 2014 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 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. Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted October 8, 2014 Report Share Posted October 8, 2014 450play 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 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.