| View previous topic :: View next topic |
| Author |
Message |
RL
Joined: 05 Jul 2004 Posts: 1
|
Posted: Mon Jul 05, 2004 8:46 am Post subject: Get text position in a webpage? (non-string) |
|
|
Hi,
I'm new to this one, so I'm sorry if this question has been asked before. I've tried looking for teh answer, but could not find it.
Is there a way to work out a position of text in a window (like a webpage for example), so I can send the mouse click to it? Yes, I can work out the location from clicking on the webpage and recording it... but what if the position of the text is shifting? (things like a URL, or a button, or just text)
And is there a way to find a position, or a cell in a table, and get the information from it, without having to parse the webpage source code? Thanks |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10463
|
Posted: Mon Jul 05, 2004 1:40 pm Post subject: |
|
|
If the object on the web page is in a control, it might be possible to get its position with ControlGetPos. Another option would be to use the tab key repeatedly to navigate to the correct URL or button. Also, you could try selecting sections of text with MouseClickDrag until you find the right one.
Finally, there is PixelGetColor/PixelSearch or some kind of 3rd party OCR method. By looking for a series of 2 or 3 pixels in exact colors and relative positions to each other, you might be able to recognize a unique trait of the target object (if there is anything about its image that is unique). |
|
| Back to top |
|
 |
WhiteCloud
Joined: 19 Jun 2004 Posts: 68
|
Posted: Mon Jul 05, 2004 4:14 pm Post subject: |
|
|
you can have the cursor move around and have it repeatedly check the status bar on internet explorer for any specified links. You can even have the cursor change direction if it gets to a nearby link. It sounds like something fun to code actually.
StatusBarGetText
Retrieves the text from a standard status bar control.
to get any information from a webpage i'm finding it's almost always best to parse the source since it's more reliable. It seems like a more complicated way but it's usually simpler for the tasks i've done. _________________ AHK = Hella fun |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10463
|
Posted: Mon Jul 05, 2004 5:46 pm Post subject: |
|
|
| That's a great idea. |
|
| Back to top |
|
 |
|