Results 1 to 1 of 1

Thread: How to get certain content from a website?

  1. #1
    Join Date
    Apr 2009
    Posts
    46
    Thanks
    4
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to get certain content from a website?

    As the title says, for example from site www.qtcentre.org I'd like my application to return first word that is standing next to searched phrase i.e. "Qt". So I'd get "Community" as a result.

    Qt Code:
    1. QString url("http://www.qtcentre.org");
    2. QWebView web;
    3. web.setUrl(url);
    4. qDebug() << web.findText("Qt");
    To copy to clipboard, switch view to plain text mode 

    I tried to check first if it will give me anything at all, but this example always return false. Same happened when I tried to use QWebFrame and toPlainText(), the result was "'".
    So is there any example how to get some text from a site? I don't want to view anything, just get simple text. =/

    Edit. I made it work exactly as I wanted, but I had to put WebView widget onto my app. =/
    Last edited by RSX; 3rd June 2009 at 07:02.

Similar Threads

  1. Eclipse/GDB: How can I see QString content?
    By GodOfWar in forum Qt Programming
    Replies: 7
    Last Post: 16th March 2009, 17:20
  2. Replies: 1
    Last Post: 12th November 2008, 08:15
  3. Saving QLabel content in a file
    By Caius Aérobus in forum Newbie
    Replies: 1
    Last Post: 29th October 2008, 17:03
  4. Printing the content
    By veda in forum Qt Programming
    Replies: 7
    Last Post: 27th December 2007, 12:03
  5. Resizing a QDialog to the content size
    By Nyphel in forum Qt Programming
    Replies: 8
    Last Post: 15th March 2007, 08:16

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.