Jump to content
Sign in to follow this  

How to get the Title of a Link ?

Recommended Posts


How can I take the title of a link, just like the browsers does ? For example , as you know, all the tabs from the browser, have a name, based on what link is opened in them. So how can I take that name of a link with AutoIT and without the help of the browser ?

Edited by Rickname

Share this post

Link to post
Share on other sites

Yes, the examples are the best methods to explain it better :

I uploaded the picture :post-78453-0-62370700-1391375658_thumb.j

That titles I want to extract, NOT EXACTLY THIS ONES , but any title from any link !

Edited by Rickname

Share this post

Link to post
Share on other sites

Look up WinGetTitle in the help file.

Share this post

Link to post
Share on other sites

have a look to all the _IE* function in the help

maybe the _IELinkGetCollection function can be of help for your case

when you have a reference to the link, use the .href property to "extract" the url of that link

(see the example in the help)


sorry, misunderstood your question
what you need should be the ".document.title" property
if you use IE try this as example:

#include <IE.au3>
$oIE = _IECreate("www.autoitscript.com")
Edited by PincoPanco

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Share this post

Link to post
Share on other sites

Great Information Danp2 ! I did what you said, and it worked :

So you just need to get the source of the webpage via this function : _IEDocReadHTML() , then extract the text that is enclosed between the <title> </title> tags !

Thats the name of the link !

Thankyou so much !

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  

  • Similar Content

    • Nareshm
      By Nareshm
      Its Possible To auto Login with autoit script ?
    • ur
      By ur
      I saw few UDFs related to IE and Firefox to automate tasks related to these browsers.
      But is it possible to automate tasks like drag and drop in the website.?
      Like in the below video.
      If not can you tell me some alternatives, as it is not possible in selenium as I heard.
    • AnonymousX
      By AnonymousX
      I need to pull data from company intranet website. I created a script that I can give a list of project numbers and it will open up the the related webpage for each project, save the html comments for that project, then move on to the next. 
      However my problem comes in that each time I open up a project it locks it for other users, and if you just exit the page it keeps it locked, you have to actually press the "close" button on the page. So I'm not sure how to deal with this as I end up just locking every project in my name when I run my program as I don't understand the nature of how the website is built. I don't understand how to close with just using my automation code without manually having to press the stupid button. 
      My Function:
      Func Getscript($ProjectAddress) ;getting the page source code and storing it into text file for easy reading it $file = FileOpen(@ScriptDir & "\source.txt", 10) $IE = _IECreate($ProjectAddress & ".html", 0, 0) $source = _IEDocReadHTML($IE) FileWrite($file, $source) $target_source = _StringBetween($source, "<BODY>", "</BODY>") ; only take content between the specified tags _IEQuit($IE) FileClose($file) return $target_source[0] EndFunc ;==>Getscript  
      Source Code I got from website that I think is relevant:
      function closeForm(){ if(topButtonEnabled("closeButton")){ parent.mainFrame.closeForm(); } } <button id="closeButton" class="saveCloseButton" style="LEFT: 77px;" onclick=closeForm()>&nbsp;Close&nbsp;</button>  
      Any Ideas of how to tell website to either activate the closeform function or just give it the command to close?
    • Pintu
      By Pintu
      Good evening guys,
      i'm having a problem, not about the code (i'm only thinking about it at the moment) but about the way i can do it.
      I have a webpage (photo N.1) it has some elements in it.
      I need only the table (photo N.2), looking at the code and with _IEFunctions i can easy find the table but how i can i "copy" it?
      As i said it's really easy to found with a script but what should i do then? Copy the source? And how can i display it to the user?
      In my head i'd like to display it inside a GUI, is that possible?
      Thanks in advance
      Edit: Posted 2 times same photo. Now should be OK


    • nacerbaaziz
      By nacerbaaziz
      please i need to link a progress bar with a time can you help me?
      i want to set a progress bar for 10 sec
      am waiting for your answers
      thank you.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.