[NScrape Web Scraping] Fill input and to click on a button

Forge Component
Published on 2017-07-06 by André Vieira
2 votes
Published on 2017-07-06 by André Vieira


I'm trying to do web scraping in a page that requires validation, that is, I have to add some data to a form, click on a button and scrap the page loaded after that. 

I don't know how to fill the fields and to click with the extension.

Hi Julio,

You have two methods in the extension to scrape pages that have forms, either an HTML form or ASPX webform. Each method receives a list of inputs as a parameter, each of which you will have to provide the name (of the input) and the value you want the input to have.

Hi André!

The exact sequence I should make is:

  1. Navigate to page. (Ok, that's easy).
  2. Click on a button of loaded page. How I click on a button with extension methods?
  3. The click on button navigate to another URL. How I get the page loaded after that? The new page loaded after navigation is in HtmlDocumentNode of initial HtmlDocument_Load method?
  4. Fill a form. This is OK, with ScrappeHtml_form method you told me.

So, how I make click on a button of scrapped page and then how I get the page loaded after that?

Thx again,


If the first button only navigates to the second page you should be able to get that URL and use it. I don't think the library has the ability to click on buttons.

Sorry, I can't navigate directly to second page, because link en firts is dinamically generated; besides, second page needs cookie and session info generated in first, so I need simulate navigate to the first, and after that, make click on a button to go to the second.