need help with QNetworkAccessManager



  • hi i'm trouble with java script question in result QNetworkAccessManager

    the question is may i able to turn java script on with QNetworkAccessManager ?

    here the result link text

    QEventLoop              * eventLoop = new QEventLoop();
    QNetworkAccessManager   * mgr       = new QNetworkAccessManager();
    QNetworkRequest request = QNetworkRequest(QUrl(Url));
    
    QObject::connect(mgr, SIGNAL(finished(QNetworkReply*)), eventLoop, SLOT(quit()));
    request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded");
    request.setRawHeader( "User-Agent", this->UserAgentString );
    
    QNetworkReply * reply = mgr->get(request);
    eventLoop->exec();
    
    QMessageBox msgBox;
    msgBox.setText(reply->readAll());
    msgBox.exec();


  • You probably want to use QtWebEngine rather than QNetworkAccessManager



  • i'm done by adding cookie from my web browser

    request.setRawHeader( "Cookie", "__cfduid=d09917d23131b763dde1c7b17bc521a9a1499742347" ); // cookie

    but my new question how to auto generate __cfduid
    should i'm debug the website first ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.