AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to send ClickOnAHyperLink without X,Y coordinates?

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ottenm



Joined: 04 Apr 2008
Posts: 4

PostPosted: Fri Apr 04, 2008 5:34 pm    Post subject: how to send ClickOnAHyperLink without X,Y coordinates? Reply with quote

Is there a way to make an HTML control the target of a click, rather than using X,Y coordinates? I have a sequence I recorded with ASW where I need to click on a particular hyperlink, but it's X,Y location is not always identical. The target of the link is always different, but the display text is always identical.

Thanks for any help.

Mike
Back to top
View user's profile Send private message
PurloinedHeart



Joined: 04 Apr 2008
Posts: 209
Location: Canada

PostPosted: Fri Apr 04, 2008 7:25 pm    Post subject: Reply with quote

Using tab to cycle through links might work.
Back to top
View user's profile Send private message
jaco0646



Joined: 07 Oct 2006
Posts: 666
Location: MN, USA

PostPosted: Fri Apr 04, 2008 7:35 pm    Post subject: Reply with quote

Download the page (UrlDownloadToFile). Parse it for the link, and Run it. Then you don't need a click.

If you search the forum for parsing HTML, there are many examples.
_________________
http://autohotkey.net/~jaco0646/
Back to top
View user's profile Send private message Visit poster's website
ottenm



Joined: 04 Apr 2008
Posts: 4

PostPosted: Thu Apr 10, 2008 6:38 pm    Post subject: Reply with quote

Good suggestions, but no luck with either one.

I'm trying to automate a few step through a web app and it turns out the start page is just different enough from time to time, to thwart tabbing to the hyper link. And downloading and parsing the html is a mess because I'm paging through forms (with state variables), not just simple hyperlinks.

The labels on the links are always identical, if there were some way to navigate by control label.

Does anyone know another hotkey or scripting tool that might have something like this?

Thanks-
Back to top
View user's profile Send private message
TheIrishThug



Joined: 19 Mar 2006
Posts: 381

PostPosted: Thu Apr 10, 2008 6:40 pm    Post subject: Reply with quote

You can try looking into Javescript injection.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Guest






PostPosted: Thu Apr 10, 2008 10:42 pm    Post subject: Reply with quote

Screen shot and Image search work
Back to top
ottenm



Joined: 04 Apr 2008
Posts: 4

PostPosted: Thu Apr 10, 2008 11:47 pm    Post subject: Reply with quote

Quote:
Screen shot and Image search work


please explain?
Back to top
View user's profile Send private message
Hasso



Joined: 23 Mar 2005
Posts: 158
Location: Germany

PostPosted: Mon Apr 14, 2008 11:38 am    Post subject: Reply with quote

ottenm,

could you provide us with the URL of that page? I think a JavaScript solution might be the best way.
_________________
Hasso

Programmers don't die, they GOSUB without RETURN
Back to top
View user's profile Send private message
Oberon



Joined: 18 Feb 2008
Posts: 453

PostPosted: Mon Apr 14, 2008 12:51 pm    Post subject: Reply with quote

You can debug the JavaScript to see what's being posted and where. This way you can UrlDownloadToFile or automate with cURL.
Back to top
View user's profile Send private message
halweg



Joined: 27 Jan 2005
Posts: 103
Location: Germany, Dresden

PostPosted: Mon Apr 14, 2008 1:01 pm    Post subject: Reply with quote

Why not a text search? Here that works for IE6:
Code:
#q::
SEND, ^f
SLEEP, 700
SEND, Ask for Help{ENTER}{ESC} ;*** Replace "Ask for Help" with your Link Text
SLEEP, 500
SEND, {TAB}{ENTER}
RETURN

(I know, WINWAIT works better, but it depends on the IE language)
_________________
Back to top
View user's profile Send private message
ottenm



Joined: 04 Apr 2008
Posts: 4

PostPosted: Mon Apr 14, 2008 3:58 pm    Post subject: Reply with quote

That's awesome halweg, never thought of it but it works perfectly. I really wanted to stay out of parsing and automating the requests due to a lot of hidden/state variables in the forms. Definitely doable, but a lot of overhead in this instance.

Thanks for all the suggestions from others, extremely helpful.

Mike
Back to top
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 1033

PostPosted: Mon Apr 14, 2008 9:27 pm    Post subject: Reply with quote

http://www.autohotkey.com/forum/viewtopic.php?t=30599
also see this
_________________
Read this
Com
Automate IE7 with Tabs
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group