Hi
I want to read all the information available from the website "http://www.nseindia.com/marketinfo/comp… about the stock DLF.
I am using Qt4 C++.
Being a newbie I need some help for the same.
Thanks in Advance.
Hi
I want to read all the information available from the website "http://www.nseindia.com/marketinfo/comp… about the stock DLF.
I am using Qt4 C++.
Being a newbie I need some help for the same.
Thanks in Advance.
You need to use these classes QNetworkAccessManager, QNetworkReply, QNetworkRequest to send requests and get a reply where you can manipulate the data you got.
There are some examples in the documentation showing the use of those classes.
Hope to helped a little![]()
Misha R.evolution - High level Debugging IDE
Programming is about 2 basic principles: KISS and RTFM!!!
I have tried it. But am not able to read the data into string. Below is my code. Can u tell what is the error that I am doing...
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
QNetworkRequest request;
request.setUrl(QUrl("http://mobile.flightview.com/TrackByFlight.aspx"));
QNetworkReply *reply = manager->get(request);
textArea = new QTextBrowser;
if (reply->error() == QNetworkReply::NoError){
textArea->setText("[" + QDateTime::currentDateTime().toString() + "] :: "\
"The file has been successfully read from the network");
textArea->append("[" + QDateTime::currentDateTime().toString() + "] :: "\
"URL Used: " + reply->url());
QByteArray bytes = reply->readAll();
QString string = QString::fromUtf8(bytes);
QString Temp_1;
Temp_1 = string.section(",", 0,0);
textArea->append("[" + QDateTime::currentDateTime().toString() + "] :: "\
"Reply size: \n" + reply->error());
textArea->append("[" + QDateTime::currentDateTime().toString() + "] :: "\
"Line Read :\t" + Temp_1);
}else{
textArea->append("[" + QDateTime::currentDateTime().toString() + "] :: "\
"There is an error reading from network...");
}
The call is asynchronous - use a slot.
Thanks fatjuicymole. It works fine now. I have to now parse the html code to get the desired output.
Last edited by abghosh; 21st February 2010 at 03:12.
Bookmarks