Jump to content
Sign in to follow this  
Foolke

Find link on webpage

Recommended Posts

Hello,

In the script i am writing I want to search on a webpage for a Link. In fact that link is not text but a picture where you can click on.

I wanne use the script on different PC's so i can't use the location of the link (button). I can send some tabs to select the button but some PC's has a google or other toolbar, others don't. So when i send, lets say 5 tabs, sometimes i get to the button sometimes i have an other button.

Can some 1 help me please.

Thx,

Foolke

Share this post


Link to post
Share on other sites

yes.. depending on the users settings, and browser.. tab is definately not reliable.

try maybe pixelsearching an area where the icon should be.

or heres an idea....

wait for the page to load.. (check the status bar text for "done")

then, use comspec to run the link. the actual text link (hover mouse over picture to see the link in the status bar)

hell... skip the first page all together.. and just go to that link

what do you think?


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

wait for the page to load.. (check the status bar text for "done")

then, use comspec to run the link. the actual text link (hover mouse over picture to see the link in the status bar)

hell... skip the first page all together.. and just go to that link

what do you think?

<{POST_SNAPBACK}>

Purpose of the script is to do an availability check of some webpages. So i can't skip the first page. I have to check if that page is available. The other problem is that the link starts a javascript (statusbar text :java script:calcUTCOffset();document.logonForm.submit() ) So I don't know exactly what link to go to. I don't even know if i can go to the page without displaying the firqst page.

Share this post


Link to post
Share on other sites

I believe you can actually direct your browser to the javascript command. Someone answered a post of mine to that effect quite a while ago, and I was amazed that it worked.

You may need to populate the form of course.

All this can be done from AutoIt.

Depending on your problem, you might just save the web page, and then do a search on the links you're looking for.

You may also try accessing the text in the Status Bar. Hopefully, the machines will respond similarly, but might depend on OS and Browser make/version.

J

Edited by jdickens

If I am too verbose, just say so. You don't need to run on and on.

Share this post


Link to post
Share on other sites

If you know the name of the picture you can then search the source code for it and find the link it is attached to.


qq

Share this post


Link to post
Share on other sites

I use the loop shown below to deal with variations in number of tabs.

I tab around until I "see" some window text that I want... I do not even wait for the page to "load"... meaning nothing has displayed on the screen within the browser, but the info is "there" and the script sends the data that I want. Make sense?

While 1
    Send("{TAB}")
    If WinExists("Microsoft Internet Explorer", $S_window_text) Then ExitLoop
    Sleep(50)
WEnd

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

I use the loop shown .... Make sense?

It sure made sense ... now its working, Thx

Does some one perhaps know if i have tos save the page and look in the html if I want to find a normal link from a list of different links or is there an other way. Maybe there is some example code some where.

Thx all,

Foolke

Share this post


Link to post
Share on other sites

In the brave new world of COM in the latest betas, you can use the IE Document Object Model and the "links" collection on the current document. More information about that collection in MSDN here: http://msdn.microsoft.com/library/default....netexplorer.asp


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...