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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:25:34+00:00 2026-05-10T14:25:34+00:00

I need to automate a process involving a website that is using a login

  • 0

I need to automate a process involving a website that is using a login form. I need to capture some data in the pages following the login page.

I know how to screen-scrape normal pages, but not those behind a secure site.

  1. Can this be done with the .NET WebClient class?
    • How would I automatically login?
    • How would I keep logged in for the other pages?
  • 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. 2026-05-10T14:25:35+00:00Added an answer on May 10, 2026 at 2:25 pm

    One way would be through automating a browser — you mentioned WebClient, so I’m guessing you might be referring to WebClient in .NET.

    Two main points:

    • There’s nothing special about https related to WebClient – it just works
    • Cookies are typically used to carry authentication — you’ll need to capture and replay them

    Here’s the steps I’d follow:

    1. GET the login form, capture the the cookie in the response.
    2. Using Xpath and HtmlAgilityPack, find the ‘input type=hidden’ field names and values.
    3. POST to login form’s action with user name, password, and hidden field values in the request body. Include the cookie in the request headers. Again, capture the cookie in the response.
    4. GET the pages you want, again, with the cookie in the request headers.

    On step 2, I mention a somewhat complicated method for automating the login. Usually, you can post with username and password directly to the known login form action without getting the initial form or relaying the hidden fields. Some sites have form validation (different from field validation) on their forms which makes this method not work.

    HtmlAgilityPack is a .NET library that allows you to turn ill-formed html into an XmlDocument so you can XPath over it. Quite useful.

    Finally, you may run into a situation where the form relies on client script to alter the form values before submitting. You may need to simulate this behavior.

    Using a tool to view the http traffic for this type of work is extremely helpful – I recommend ieHttpHeaders, Fiddler, or FireBug (net tab).

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

Sidebar

Related Questions

I need to automate a process that involves getting data from a series of
I have a multilanguage website and need automate the process of updating textlayers in
I need to automate a process whereby attachments are automatically downloaded from messages in
I'm trying to automate InstallShield from my build process, and I need to set
I need to automate the following command cmd=yes | vgremove <vgname> whenever I code
I need to automate navigation around a JavaScript powered website in Python so I
I am working on a project where I need to automate some workflows in
I have some pdf documents and I need to find a way to automate
This is the new input file format. I need to automate the process of
I need to automate the build/deploy process for my iphone applications from a script.

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.