3

I am making a web scraper. In that I need to login into my email account programatically. Can anybody say how to achieve that. I think "QNetworkAccesManager" and it's "get()" can make this. But, I don't know exactly. Somebody please shed a light on this issue.

Note: I am using Qt-4.7.2 + C++

Widor
  • 13,003
  • 7
  • 42
  • 64
prabhakaran
  • 5,126
  • 17
  • 71
  • 107

1 Answers1

2

If the login is done in a web page then you should perform a post operation using QNetworkAccessManager::post() including the login fields in the data.

For instance:

QNetworkAccessManager network;
QByteArray loginData("user=myName&password=myPassword");
QNetworkRequest request(QUrl("http://mySite.com/login"));
QNetworkReply* pReply(network.post(request, loginData);

If the login is done via HTTP authentication method then you should connect the signal QNetworkAccessManager::authenticationRequired to one slot and fill the authentication data there.

Paolo Brandoli
  • 4,681
  • 26
  • 38
  • These are the properties of the element first element Email Id: . In this Which have to be passed? – prabhakaran Oct 05 '11 at 02:11
  • This is the site which I have to login "naukri.com". It has a login in the right side. I am not that much good in web languages. – prabhakaran Oct 05 '11 at 02:17