jacobraccuia Posted March 3, 2010 Share Posted March 3, 2010 I have created a wonderful program to help my company out at work. One part of it goes to a website and types in an IP address. Occasionally there is information that is needed to grab. Sometimes there isn't. I originally had a message box pop up w/ an if then. If there was information you would click yes, and it would take the information. If there wasn't you click no and it does something else. I want to automate this! Either by detecting a link on the page, or comparing page sizes. I have no idea where to start. Any ideas? thanks! Jacob Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 3, 2010 Share Posted March 3, 2010 Start by trying out the example scripts under each of the _IE* functions in the help file. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
jacobraccuia Posted March 3, 2010 Author Share Posted March 3, 2010 (edited) I see that this can get me some information regarding the page, although nothing seems specific to detecting links, etc. And even if it detects the link, how do I make it choose what to do? Edit: not to mention I would rather not use IE... Edited March 3, 2010 by jacobraccuia Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 3, 2010 Share Posted March 3, 2010 (edited) You already tried _IELinkGetCollection(), _IEAction(), _IEPropertyGet($oLink, "innerText"), etc.? If it didn't work, post what you tried for more help. Edit: I would rather not use IE too, but that is the browser that exposes a COM interface to AutoIt. Firefox, Safari, Chrome, etc. don't expose an interface AutoIt can use. Edited March 3, 2010 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
jacobraccuia Posted March 3, 2010 Author Share Posted March 3, 2010 I didn't know that. I will switch over to IE and see what I can get done and then post back! Link to comment Share on other sites More sharing options...
jacobraccuia Posted March 3, 2010 Author Share Posted March 3, 2010 (edited) So this link thing is very cool. I don't know how to set it up with an If then though. If "link 0" exists, I want it to continue If not, then I want it to follow instructions. Essentially, if the link is present, it goes. If the link isn't present, it stays. Thanks, i hope you can help, cause I have no idea! One idea I had was $sText = _IEBodyReadText ($oIE) If $stext = ???? Then Exit If the page says "Tech DB Search Results for (random IP here) No Lease Found" I need it to Exit, but I don't know to set that equation Thanks! Edited March 3, 2010 by jacobraccuia Link to comment Share on other sites More sharing options...
PsaltyDS Posted March 3, 2010 Share Posted March 3, 2010 On that basic level: $sText = _IEBodyReadText ($oIE) If StringInStr($sText, "Tech DB Search Results for") And StringInStr($sText, "No Lease Found") Then ; ... do stuff EndIf With more experience in the IE.au3 UDF you can just get the text of that one element instead of the whole page to check. For the kind of geekiness that attracts women, you can replace StringInStr() with StringRegExp(), etc. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
jacobraccuia Posted March 5, 2010 Author Share Posted March 5, 2010 Yes, thank you so much! I removed the first StringInStr command "tech DB search results" and just had the No Lease Found part, and it worked perfectly! I don't really know what it means, but thank you! 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