Results 1 to 4 of 4

Thread: QWebView - How to get DOM HTML

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2011
    Location
    Brazil, SC.
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWebView - How to get DOM HTML

    @Spitfire this has nothing to do with it, the static HTML will never show any values updated by JS, it doesn't matter when you get it, the static html is "static". You have to check the DOM html to achieve this. But thanks for replying!

    @wysota Although I was expecting an example, I was able to solve my problem quickly after you assured me that the right way would be using the WebElement API. So thanks, I've solved my problem.

    A simple answer to my original poust would be:
    Qt Code:
    1. QWebElement e = ui->browser->page()->mainFrame()->findFirstElement("span#Countdown");
    2. qDebug() << e.toPlainText(); //a qDebug just to check it right now - it returns exactly the "2h 44m 18s" as I've mentioned above
    To copy to clipboard, switch view to plain text mode 

    Topic SOLVED.
    Last edited by lhg; 23rd October 2011 at 19:22.

Similar Threads

  1. Need help in Qwebview, find test in HTML page
    By keyurparekh in forum Qt Programming
    Replies: 3
    Last Post: 18th May 2011, 14:29
  2. [4.7] QWebView + Qt aware HTML
    By bunjee in forum Qt Programming
    Replies: 0
    Last Post: 25th October 2010, 10:49
  3. Parse RSS into html and display it in QWebView.
    By halvors in forum Qt Programming
    Replies: 11
    Last Post: 14th August 2010, 12:44
  4. Html page Display in QWebView
    By Tavit in forum Qt Programming
    Replies: 4
    Last Post: 10th July 2010, 15:39
  5. How to save a Qwebview as an html file
    By richardander in forum Qt Programming
    Replies: 2
    Last Post: 5th June 2009, 00:07

Tags for this Thread

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.