kosu Posted July 8, 2014 Share Posted July 8, 2014 Hey guys! New to the forums but not to Autoit. For an internal system at my company, I need to fire an Autoit function when a given text is shown in a browser to the user. The thing is I need this to work with IE, Firefox and Chrome. I have NO idea how to start! How can I look for a string in the browser? The only idea I have is OCR, which is ridicoulous, you can't take a screenshot and OCR it every 2 seconds... So, monitor the cache??? Or is there anyway to interact with all 3 (maybe in different ways, if you can offer an idea for one, GREATLY appreciated)? Thanks! Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 9, 2014 Share Posted July 9, 2014 (edited) Welcome to the Forums here. I have re-written and shrunk down a bit of code that I use regularly. This bit of code only requires that IE be installed on the machine it is run on. Change the variable $Find from peace, as it is now, to hate to see the difference. Good luck with you project. #include <INet.au3> Local $URL = "http://somdcomputerguy.com", $Source, $Result, $Find = "peace" $Source = _INetGetSource($URL) $Result = StringInStr($Source, $Find) If $Result <> 0 Then MsgBox(0, "", "Yay!") Else MsgBox(0, "", "No " & $Find & " at " & $URL) EndIfI am very poor at commenting my code, so refer to the Help file for any function or code logic descriptions. Edited July 9, 2014 by somdcomputerguy kosu 1 - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
kosu Posted July 10, 2014 Author Share Posted July 10, 2014 Hi man! Thanks for your response. The thing is that, more than monitoring the content of a site, what I need to operate with this old web interface propietary software, is to interact with the content displayed to the user in his or her own browser, do you get the difference? So, the user browses using Firefox, Chrome or IE to www.random.com, when the user sees "blahblahblah" as text, THEN I need to fire up the function, not when the site itself has it. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 10, 2014 Share Posted July 10, 2014 Oh, I get it. When a user, using whatever browser they use, goes to a site and sees themselves some particular text, some action will then be performed. That does make things more difficult though. There is a set of functions for Internet Explorer built into AutoIt, and there are individual UDF's available on this forum for Firefox, Chrome, and Opera. I'm not too sure about the last two.. In the Example Scripts forum, there is also a UDF for generic (not browser related) HTTP functions. This is probably what will do it for you. I just quickly searched thru that forum, and I believe this is it - WinHTTP functions - '?do=embed' frameborder='0' data-embedContent>> Again, good luck with your project. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
JohnOne Posted July 10, 2014 Share Posted July 10, 2014 '?do=embed' frameborder='0' data-embedContent>> kosu 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 10, 2014 Share Posted July 10, 2014 (edited) You know, that looks much better than my suggestion. Thanks JohnOne. Edited July 10, 2014 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
kosu Posted July 15, 2014 Author Share Posted July 15, 2014 Guys, if anyone is able to help, I'm able to pay you for the assistance, we could set up an arrangement via Elance or a similar site. The link posted by John seems like it would do the trick, but it's a bit advanced for me and I need this set up soon. Let me know. Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 15, 2014 Share Posted July 15, 2014 (edited) The thing is that, more than monitoring the content of a site, what I need to operate with this old web interface propietary software, is to interact with the content displayed to the user in his or her own browser, do you get the difference? So, the user browses using Firefox, Chrome or IE to www.random.com, when the user sees "blahblahblah" as text, THEN I need to fire up the function, not when the site itself has it. Guys, if anyone is able to help, I'm able to pay you for the assistance, we could set up an arrangement via Elance or a similar site. The link posted by John seems like it would do the trick, but it's a bit advanced for me and I need this set up soon. This sounding more and more like a 'CAPCTHA breaking' sort of script that you want.. Perhaps if you could better describe what you want, you could get better help. Edited July 15, 2014 by somdcomputerguy - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now