Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to Check Is Domain Indexed in Google from Qt application code
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zain
    wrote on last edited by
    #1

    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="http://www.google.com/search?q=site:msn.com";
    reply234 =manager.get(QNetworkRequest(QUrl(googleUrl)));
    

    connect(reply234, SIGNAL(finished()), &loop2, SLOT(quit()));
    loop2.exec();
    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="http://www.google.com/sorry/?continue=http://www.google.com/search?q=site:msn.com">here</A>.
    </BODY></HTML>
    "

    And some time blank or just like this "".

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

    Thanks in advance
    Zain

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Code_ReaQtor
      wrote on last edited by
      #2

      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.

      Please visit my open-source projects at https://github.com/Code-ReaQtor.

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zain
        wrote on last edited by
        #3

        @ 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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved