Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8482581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:51:40+00:00 2026-06-10T19:51:40+00:00

I’m writing a simple web spider. The idea is to get a page programmatically

  • 0

I’m writing a simple web spider.
The idea is to get a page programmatically using QNetworkAccessManager, QNetworkReply and QNetworkRequest, everything works fine.

The problem I encounter is that (for some pages) I get different/unmatching results programmatically or by visiting “manually” the page with a browser.
I always get sintactically correct HTML pages, but they look to me like some sort of “spider protection” answers.
The pages I’m referring AREN’T POST pages, the tests I’m doing are with very simple url pages, sometimes with parameters (e.g. http://www.sample.com/index.php?param=something), sometimes even with plain page.html urls.

The pseudocode is as follows:

QNetworkRequest req;
req.setUrl(QUrl(myurl));
req.setRawHeader(*I did try this one with no success*);
QNetworkAccessManager man;
QNetworkReply rep = man->get(req);
//finish and error slots connection code here

.
.
.

void replyFinished()
{
    QNetworkReply* rep = qobject_cast<QNetworkReply *>(sender());
    if (rep->error() == QNetworkReply::NoError)
    {
        // read data from QNetworkReply here
        QByteArray bytes = rep->readAll();
        QString stringa(bytes); 
        qDebug() << stringa;
    }
}

In the finish() slot I’m printing the data from the networkreply and sometimes I get unmatching results from the simple “View Source” operation in the browser got by visiting by hand the url.

Sometimes I get a custom “Not found” page, sometimes some more weird pages with logins forms or other unexpected contents.
Maybe it’s some kind of spider protection ? Can anyone help ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T19:51:41+00:00Added an answer on June 10, 2026 at 7:51 pm

    There are 3 main methods protecting from webspiders:

    • Web browser identification – using message headers the website is seeing the difference between browser and web-crawlers. You write that you used raw headers – are you sure that you provide the same headers and values your browser does?
    • Session data/coockies – closely related to previous ones. Login forms suggest that website is expecting to get some informations that browser would normally send.
    • Javascript code printing actual html data into web document. Are you checking if you get the same html cody by checking source of a website in your web browser (view->source), or are you checking html layout by some tool like Firebug?
    • Javascript redirecting – browser is downloading website that is using javascript to redirect you to the website with actual content.

    As far as the first two options go – you should use some tcp/ip sniffer like Smart sniff to check if data sent by browser are equal to those sent by your program. If it’s equal, that means that you are probably hitting some sort of javascript-barrier. If so, you might try to use some javascript-enabled browsing engine like QWebPage. I don’t know if it’s executing it’s javascript when not connected to any QWebView though – perhaps a hidden view might be necesary.

    If I find myself in a situation that I need to impersonate browser to some remote service, I usually simply write Firefox-plugin (using javascript); that usualy eliminates any of above problems 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm making a simple page using Google Maps API 3. My first. One marker
Seemingly simple, but I cannot find anything relevant on the web. What is the
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.