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 8020675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:45:13+00:00 2026-06-04T21:45:13+00:00

Using System.Net.HttpRequest I would like to imitate a users search on the following search

  • 0

Using System.Net.HttpRequest I would like to imitate a users search on the following search engine in my code.

http://www.scirus.com

An example of the search URL is as follows:

http://www.scirus.com/srsapp/search?q=core+facilities&t=all&sort=0&g=s

I have the following code to perform the HTTP GET. Note I’m using the HtmlAgilityPack.

protected override HtmlDocument MakeRequestHtml(string requestUrl)
{
    try
    {
        HttpWebRequest request = WebRequest.Create(requestUrl) as HttpWebRequest;
        request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)";
        HttpWebResponse response = request.GetResponse() as HttpWebResponse;

        HtmlDocument htmlDoc = new HtmlDocument();
        htmlDoc.Load(response.GetResponseStream());
        return (htmlDoc);

    }
    catch (Exception e)
    {
        Console.WriteLine(e.Message);
        Console.Read();
        return null;
    }
}

Where “requestUrl” is the example search URL shown above.

The contents of htmlDoc.DocumentNode.InnerHtml contains no search results and looks nothing like the search results page you would get if you copy pasted the example search URL shown above into your browser.

I’m guessing the reason for this is because you must first have a session in order to be able to perform requests. Can anybody advise if there is a feasible way to replicate the behavior of the user agent? Or perhaps there is a better way of achieving the goal of “scraping” the search results that I don’t know about? Suggestions please.

Robots.txt contents:

# / robots.txt file for http://www.scirus.com

User-agent: NetMechanic
Disallow: /srsapp/sciruslink

User-agent: *
Disallow: /srsapp/sciruslink
Disallow: /srsapp/search
Disallow: /srsapp/search_simple
Disallow: /search_simple
# for dev and accept server uncomment below line at Build time to disallow robots completely
##Disallow: /

Content of htmlDoc.DocumentNode.InnerHtml

Response

  • 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-04T21:45:15+00:00Added an answer on June 4, 2026 at 9:45 pm

    OK I actually tested with webclient

            static void Main(string[] args)
        {
            WebClient client = new WebClient();
            client.Headers.Set("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0");
            string str = client.DownloadString("http://www.scirus.com/srsapp/search?q=core+facilities&t=all&sort=0&g=s"); 
            byte[] bit = new System.Text.ASCIIEncoding().GetBytes(str);
            FileStream fil = File.OpenWrite("test.txt");
            fil.Write(bit,0,bit.Length);
        }
    

    And here is the downloaded file http://pastebin.com/qswtgC4n

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

Sidebar

Related Questions

Using the .NET System.ServiceModel.Syndication classes... I would like to add a new SyndicationElementExtension to
The following code generates a FileNotFoundException (using .NET 2.0): using System; using System.Collections.Generic; using
Consider the following .Net ASMX web service with two web methods. using System; using
I am using System.Net.Mail email. in the code i am setting the return-path of
I'm using System.Net tracing as described here: http://ferozedaud.blogspot.com/2009/08/tracing-with-systemnet.html But that traces every request made
I'm working on a web client. Here is the code: using System.Net; using System.Net.Sockets;
I'm using system.net.mail and have a textbox that users can enter their email address
My domain model is using System.Net.Uri to represent URLs, and System.Drawing.Color to represent colors.
using System; using System.IO; using System.Net; using System.Text.RegularExpressions; namespace Working { class Program4 {
I am trying to send an email in ASP.NET using system.net.mail the problem is

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.