leehy250 Posted July 4, 2007 Share Posted July 4, 2007 hi, folksi'm new at autoit3it's really good at handling internet automationhere , my problem to be solvedi have a web and find a text then the text will be markedin this case how can i get the marked text x, y position? Link to comment Share on other sites More sharing options...
herewasplato Posted July 4, 2007 Share Posted July 4, 2007 Welcome to the forum.If your goal is to click on a link within a web page, then look in the help file under _IE_Example...If that is too hard for you right now, consider "tabbing" to the link of interest as described in this post: http://www.autoitscript.com/forum/index.php?showtopic=14395If the text on the website is not a link that you want to click on, then please explain a bit more about what you want to do.-MSP- [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
leehy250 Posted July 4, 2007 Author Share Posted July 4, 2007 Welcome to the forum.If your goal is to click on a link within a web page, then look in the help file under _IE_Example...If that is too hard for you right now, consider "tabbing" to the link of interest as described in this post: http://www.autoitscript.com/forum/index.php?showtopic=14395If the text on the website is not a link that you want to click on, then please explain a bit more about what you want to do.-MSP-Well, my poor english..When I want to find a special text "freeware" at http://www.autoitscript.com/autoit3/I use Control+F to find that text (as attached file)in this caseHow can i find text x, y position ? Link to comment Share on other sites More sharing options...
herewasplato Posted July 4, 2007 Share Posted July 4, 2007 ...How can i find text x, y position ?That might be hard to do reliably. If you find the x, y position, what are you going to do with it.There might be a better way to do the entire task - if we knew what that task was. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
leehy250 Posted July 4, 2007 Author Share Posted July 4, 2007 That might be hard to do reliably. If you find the x, y position, what are you going to do with it.There might be a better way to do the entire task - if we knew what that task was.well.After I find the text's x, y position move the mouse to that position and use Clipget() the text after "freeware" Link to comment Share on other sites More sharing options...
herewasplato Posted July 4, 2007 Share Posted July 4, 2007 Run this little sample and see if we are getting closer to what you want:#include <INet.au3> $page = _INetGetSource("http://www.autoitscript.com/autoit3/") $pageArray = StringSplit($page, @CRLF) For $i = 1 To $pageArray[0] If StringInStr($pageArray[$i], "freeware") Then MsgBox(0, "Found it", $pageArray[$i]) NextThe _INetGetSource function reads the entire page into a variable... in this case named $page. The StringSplit functions turns that page of text lines into an array: $pageArray[0] = number of lines of text on the page $pageArray[1] = first line of the web page text $pageArray[2] = next line of the web page text $pageArray[3] = next line of the web page text ...... The For/Next loop works through each line of text. The StringInStr looks for "freeware"... If "freeware" is found, the MsgBox displays that line. How much text after freeware do you want? [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
leehy250 Posted July 4, 2007 Author Share Posted July 4, 2007 Run this little sample and see if we are getting closer to what you want:#include <INet.au3> $page = _INetGetSource("http://www.autoitscript.com/autoit3/") $pageArray = StringSplit($page, @CRLF) For $i = 1 To $pageArray[0] If StringInStr($pageArray[$i], "freeware") Then MsgBox(0, "Found it", $pageArray[$i]) NextThe _INetGetSource function reads the entire page into a variable... in this case named $page. The StringSplit functions turns that page of text lines into an array: $pageArray[0] = number of lines of text on the page $pageArray[1] = first line of the web page text $pageArray[2] = next line of the web page text $pageArray[3] = next line of the web page text ...... The For/Next loop works through each line of text. The StringInStr looks for "freeware"... If "freeware" is found, the MsgBox displays that line. How much text after freeware do you want? thks for reply there is table at a web(LOOK AT THE IMAGE) let's say, what i'm going to do is find "ILSAN" at the table and i'm going to FOLLOW the link "3" just behind the "ILSAN" text the link located +x, +y position from the "ILSAN" text position Link to comment Share on other sites More sharing options...
herewasplato Posted July 4, 2007 Share Posted July 4, 2007 (edited) Someone may have to help you use the IE.au3 functions. I'm not good with them. I see now why you wanted to use the "find text" method. If no forum member comes up with a way to use the IE.au3 functions for you, then you can go back to the "find text" method that you started out with. I'm just not sure how best to do that. Is the website that you showed something that forum members could look at and test some AutoIt code on for you? Edited July 4, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
leehy250 Posted July 4, 2007 Author Share Posted July 4, 2007 Someone may have to help you use the IE.au3 functions.I'm not good with them.I see now why you wanted to use the "find text" method.If no forum member comes up with a way to use the IE.au3 functions for you, then you can go back to the "find text" method that you started out with. I'm just not sure how best to do that.Is the website that you showed something that forum members could look at and test some AutoIt code on for you?sorrythat's my company site .i'm trying to web_check_automation - open web- check error value- check detail report excel file if err- alarm if duplicate err with err detail list Link to comment Share on other sites More sharing options...
mikehunt114 Posted July 4, 2007 Share Posted July 4, 2007 (edited) Dale Hohm's IE library is the most applicable solution...however, you'll have to extract certain information from your website in order to apply it. If you can provide source, or at least the URL, we can take this another step, otherwise you're more or less on your own. Here's the idea behind the _IE* stuff.#Include <IE.au3> ;include Dale's IE library $url = "www.yourURLhere.com" $oIE = _IECreate($url, 1) #cs _IECreate() is trying to attach to an existing instance of this URL (that's what the "1" means), if it doesn't find one it will create a new IE window and navigate to the page. Now depending on the setup of your webpage, you can either click the link if it's in the main body, or else you'll have to get reference to the proper frames/forms which contain your link. #ce $oFrame = _IEFrameGetObjByName($oIE, "YourFrameNameHere") $oLinks = _IELinkGetCollection($oFrame) For $oLink In $oLinks MsgBox(0, "Link Info", $oLink.href) NextIt also looks like your link is in a table, hinting at _IETable. You'll have to provide some more info.Edit: typos Edited July 4, 2007 by mikehunt114 IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
phamdacloc Posted April 17, 2013 Share Posted April 17, 2013 I too have the same question as leehy250 about finding the text position so I can mouse over that text. I'm trying to accomplish something that's a bit different but finding the position of the text is neccessary. I'm trying to mimic what a real user would do in Google Search (i.e. type in key word and click on relevant page in SERP). I can accomplish this already by using IE.au3 to retrieve the DOM object and use document.click() to click on the link. ADDITIONALLY, I also want to find the URL link and move over it because who knows... google may send an event to their server when the mouse would be hoovered. Any tips would be appreciated. Link to comment Share on other sites More sharing options...
Decipher Posted April 17, 2013 Share Posted April 17, 2013 (edited) phamdacloc,Welcome to the AutoIt Forums. Tip #1 is don't revisit 6 year old topics, instead create a new one.I'll look into it for ya. *Edit - Here ya go Anonymous Edited April 17, 2013 by Decipher phamdacloc 1 Spoiler Link to comment Share on other sites More sharing options...
phamdacloc Posted April 18, 2013 Share Posted April 18, 2013 (edited) Decipher - big thanks. This is exactly what I wanted. Edited April 18, 2013 by phamdacloc Link to comment Share on other sites More sharing options...
mmrad1 Posted August 29, 2016 Share Posted August 29, 2016 Yeah, is it a way to find those coordinates without using ::include <ie3.au3>. I am looking to find coordinates of a text on a screen or a window to make a specific action. Thanks Link to comment Share on other sites More sharing options...
junkew Posted August 29, 2016 Share Posted August 29, 2016 besides necroposting its better to open a new supportquestion and provide with more details. Is it an html page, which browser, ......, what did you try yourself. https://www.autoitscript.com/wiki/FAQ question 31 is probably a good starting point FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets 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