Jump to content

Getting Title of URL with _INetGetSource


Go to solution Solved by Chimp,

Recommended Posts

I am trying to obtain the title of web pages using _INetGetSource but I can not return the string, so I guess this is more of a _StringBetween question.

#include <String.au3>
#include <Inet.au3>

test()

While 1
    Sleep(100)
WEnd

Func test()
    $data = BinaryToString(_INetGetSource("https://www.autoitscript.com/forum/"))
    ClipPut($data) ;Using to paste in notepad to verify source is correct
    $data = _StringBetween($data, "<title>", "</title>") ;Find title of URL between <title> tags
    MsgBox(0, "Title", $data) ;Returns blank result
EndFunc

Below is a snapshot of the first two lines of the source, pasted directly from clipboard:

image.png.5061ec1162e3ef58dd26cbdd2769cf5e.png

Why is it not getting the string "Forums - AutoIt Forums"?

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...