PDA

View Full Version : How to get certain content from a website?



RSX
3rd June 2009, 04:26
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.



QString url("http://www.qtcentre.org");
QWebView web;
web.setUrl(url);
qDebug() << web.findText("Qt");


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. =/