Results 1 to 3 of 3

Thread: [SOLVED] Always empty QWebPage

  1. #1
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default [SOLVED] Always empty QWebPage

    Hi !

    I am trying to parse an html file with qwebelement. But when loading the qwebpage and selecting the mainframe from it, it doesn't contain anything :

    Qt Code:
    1. QWebPage *page = new QWebPage();
    2.  
    3. page->mainFrame()->load(QUrl("http://guilo19.free.fr/HD/column.html"));
    4.  
    5.  
    6. QWebFrame *frame = page->mainFrame();
    7.  
    8. std::cout<<frame->toHtml().toStdString();
    9.  
    10. QWebElement document = frame->documentElement();
    11. std::cout << document.toOuterXml().toStdString() <<"\n";
    12. std::cout << "voila";
    To copy to clipboard, switch view to plain text mode 

    I have already tried to show a qwebiew and the page did load fine.

    Thanks
    Last edited by Guilo; 30th December 2009 at 17:33. Reason: [SOLVED]

  2. #2
    Join Date
    Sep 2009
    Location
    Finland
    Posts
    63
    Thanks
    1
    Thanked 22 Times in 19 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Always empty QWebPage

    Edit: deleted ...

  3. The following user says thank you to tsp for this useful post:

    Guilo (30th December 2009)

  4. #3
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Always empty QWebPage

    QWebPage has loadFinished() signal. I have tried it and it works really great. Thanks. I first tried to use Sleep() so as to test but didn't seem to work.

Similar Threads

  1. Using QWebPage in a QThread (QtWebKit)
    By Knuckles in forum Qt Programming
    Replies: 0
    Last Post: 3rd November 2009, 18:36
  2. get website info with QWebPage
    By timmu in forum Qt Programming
    Replies: 3
    Last Post: 25th August 2009, 09:30
  3. QwebPage within a QGraphicsWidget
    By Osprey in forum Qt Programming
    Replies: 0
    Last Post: 16th June 2009, 17:32
  4. QSqlTableModel inserts empty rows
    By Nesbitt in forum Qt Programming
    Replies: 2
    Last Post: 6th August 2008, 12:47
  5. remove directory empty or not empty
    By raphaelf in forum Newbie
    Replies: 12
    Last Post: 27th October 2006, 07:30

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.