Sign in to follow this  
Followers 0
daddyt

Grab <TITLE> from html page?

4 posts in this topic

Hi, I'm opening up a browser window just fine at the moment, but I'm grabbing the text from the <TITLE> ... </TITLE> tags by reading the html and manipulating the strings...

Is there any easier way by accessing the DOM?

Thanks in advance :)

Code I'm currently using looks like this:

Func getTitle($appwindow)
    local $HTML = _IEDocReadHTML($appwindow)
    $HTML = stringlower($HTML)
    
    local $i = stringinstr($HTML,"<title>")
    $HTML = StringMid($HTML,$i+7)
    
    $i = stringinstr($HTML,"</title>")
    $HTML = Stringleft($HTML,$i-1)
    
    return $HTML
endfunc

Share this post


Link to post
Share on other sites



This will write the current page title to the console.

ConsoleWrite($oIE.document.title & @CR)

Share this post


Link to post
Share on other sites

This will write the current page title to the console.

ConsoleWrite($oIE.document.title & @CR)
That is exactly what I was after...

Thank you so much :)

Share this post


Link to post
Share on other sites

No problem, glad I could help!

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  
Followers 0