I'm navigating to a website with some parameters passed inside the URL which gives me the required info displayed on the site we navigate to. Then on the site there is an input button 'export data' which then saves the data into a nice csv file. All I need to do is automate the 'Click' of the button. I usually code in VBA so I would loop through Document.elements to get the button then simply click but as I am developing this system with asp.net web forms and I'm finding it a bit more tricky. Trouble is I don't know how to store/get the open browser page as a variable in order to click the button. Below is the code I have which you can see is very simple.
using System;
using System.Web.UI.WebControls;
namespace myNameSpace
{
public partial class DataScrape : System.Web.UI.Page
{
protected void Proceed_Click(object sender, EventArgs e)
{
Response.Redirect(url_with_params);
//Need to click a button on the redirected page.
}
}
}