Results 1 to 5 of 5

Thread: how can get all links with QT from a web page?

  1. #1

    Default how can get all links with QT from a web page?

    I do not need a window,but I hope it can parse some javascript written URL for too many web page give out the URL not so directly.

    How should I do?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how can get all links with QT from a web page?

    You can parse anything you like with QString and QRegExp.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3

    Default Re: how can get all links with QT from a web page?

    Thanks, but my problem is that, it seems not so easy to deal with some javascript which make the full real url.

    like below:

    <a href='javascript:get_url()'>something</a>


    by the way, is there any easy way to retrive a page content source?

    like
    QSomeClass q("http://google.com");
    q.GetText()
    ??
    Last edited by ChineseAlexander; 15th April 2009 at 10:28.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how can get all links with QT from a web page?

    We are touching multiple subjects here. Please provide details on what you want to achieve and what you have already tried. If you want contents of a remote page, use QNetworkAccessManager or QHttp to download it. You can execute javascript code from a webpage but you have to extract it first from the page and then feed it to QScriptEngine.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5

    Default Re: how can get all links with QT from a web page?

    Quote Originally Posted by wysota View Post
    We are touching multiple subjects here. Please provide details on what you want to achieve and what you have already tried. If you want contents of a remote page, use QNetworkAccessManager or QHttp to download it. You can execute javascript code from a webpage but you have to extract it first from the page and then feed it to QScriptEngine.

    hello wysota,

    I have done some work about retrive links from a web page with your hint,use QHttp & QRegExp.But it lays still a big problem is how to retrive some URL which is composite with javascript. The QScriptEngine is not so easy to use.

    Some days ago,I may see a interface function like xxxURLs() which may be contained in QWebKit Classes.But now,I just can't find it again. Is it a memery mistake?

    Do any one has any idea about how to Get All links completely?

    Thanks a lot,

Similar Threads

  1. Best way to open a Qt window from web page?
    By montylee in forum Qt Programming
    Replies: 9
    Last Post: 19th January 2009, 08:04
  2. Replies: 3
    Last Post: 13th September 2008, 15:12
  3. QTabWidget remove a page at the page's request
    By thomaspu in forum Qt Programming
    Replies: 2
    Last Post: 29th December 2007, 20:45
  4. page faults
    By moowy in forum General Programming
    Replies: 2
    Last Post: 20th January 2007, 14:13
  5. QWidget display on 2 stack widget page
    By spawnwj in forum Qt Programming
    Replies: 3
    Last Post: 4th September 2006, 12:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.