title: Programmatically open webpage from file and click link to handle response C#
body: <p>The scenario is that a mail is sent to an inbox. Attached to the mail is a html file which the user clicks to open the page in a browser. They then click a link on the webpage which opens a PDF file online.</p>
  
  <p>Now, what I want to achieve programmatically with c# is to save the attached html file on disk, open the file, find the link, click it and save the file that opens to disk.</p>
  
  <p>I have gotten as far as programmatically open the email and save the attached html file to disk. But now I'm sort of stuck at opening the file programmatically.
  I've gotten as far as creating a FileWebRequest to open the file but I don't know how to find the link ("a" tag, only on in the whole page) and programmatically click it (in c#) so the PDF opens so I can download it and save to disk.</p>
  
  <p>What needs to be done after the filewebrequest?</p>
  
  <pre><code>FileWebRequest req = (FileWebRequest)WebRequest.Create(pathToHtmlFile);
  FileWebResponse res = (FileWebResponse)req.GetResponse();
  // What now..?
  </code></pre>