Solved I need to get title of webpage
-
@Armin Where did I say anything about set?
-
@jsulm Thanks
In this line if i am not mistaken you set the title
request.setRawHeader("User-Agent", "MyOwnBrowser 1.0");
But i want to store the title in a QString -
@Armin No this line does not set any titles, why do you think so? Did you read the documentation? You can remove this line. It is not needed for your use-case.
-
@jsulm Thanks
now , all i want is to get url in title ( <title> ... </title> ) and put it on QString.
-
@Armin You can use a regular expression after you got the response from the server to extract the title.
-
@jsulm Thanks
If that file isn't html , and be mp4 or pdf
So what do i do ? -
@Armin Sorry, but you asked how to get the title of a web page, right?
What do you want to do with mp4 or pdf? -
@jsulm Thanks
Right , i asked about webpage
How can i name of download file?
Thanks -
@Armin The name of the file you're downloading is already in the URL, isn't it? Usually you know it in advance.
Like: http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run
File name is: qt-unified-linux-x64-online.run
Or do you want to know which files you can download from a web site? Then look for for something like:<a href="http://download.qt.io/official_releases/online_installers/qt-unified-linux-x64-online.run">Qt Online Installer for Linux (64-bit)</a>
-
@jsulm Thanks
I find answer. i use QUrl