Important: Please read the Qt Code of Conduct -

How to Check Is Domain Indexed in Google from Qt application code

  • Hello All,

    I am developing an application in which i need to check for any website whether it is Indexed in Google or not.

    I have written following code on my button click slot.

    @ QNetworkAccessManager manager;
    QNetworkReply *reply234;
    QEventLoop loop2;

    QString googleUrl="";
    reply234 =manager.get(QNetworkRequest(QUrl(googleUrl)));

    connect(reply234, SIGNAL(finished()), &loop2, SLOT(quit()));
    QString htmlOutputString= QString::fromUtf8(reply234->readAll());

    qDebug()<<"htmlOutputString :"<<htmlOutputString;

    But I am getting in debugging window most of the time in @ htmlOutputString @ following result.

    "<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
    <TITLE>302 Moved</TITLE></HEAD><BODY>
    <H1>302 Moved</H1>
    The document has moved
    <A HREF="">here</A>.

    And some time blank or just like this "".

    Any suggestion appreciated (better if code is included :) )

    Thanks in advance

  • That is a captcha code to prevent any "bots" from accessing a site. Which means that you might have violated their "Rules" or "Terms of Service". I think the best way to access google is to use their APIs.... though I am not sure which of those APIs is what you need.

  • @ Code_ReaQtor

    Thanks for reply.But i don't think so need to use any google API to search damin indexing.
    Above same logic is working in Dot Net and Adobe Air Technologies.But not in QT .
    I think I am missing something.

Log in to reply