title: accessing websites using C#
body: <p>I have a problem here. Assume there's a basic calculator implemented in javascript hosted on a website ( I have googled it and to find an example and found this one: <a href="http://www.unitsconverter.net/calculator/" rel="nofollow">http://www.unitsconverter.net/calculator/</a> ). What I want to do is make a program that opens this website, enters some value and gets the return value. So, in our website calculator, the program:
  - open the website
  - enters an operand
  - enters an operation
  - enters an operand
  - retrieve the result
  Note: things should be done without the need to show anything to the user ( the browser for example ).</p>
  
  <p>I did some search and found about HttpWebRequest and HttpWebRespond. But I think those can be used to post data to the server, which means, The file I'm sending data to must be php, aspx or jsp. But Javascript is client side. So, I think they are kind of useless to me in this case.</p>
  
  <p>Any help?</p>
  
  <p><strong>Update</strong>:
  I have managed to develop the web bot using WebBrowser Control tool ( found in System.Windows.Forms )
  Here's a sample of the code:</p>
  
  <pre><code>    webBrowser1.Navigate("LinkOfTheSiteYouWant"); // this will load the page specified in the string. You can add webBrowser1.ScriptErrorsSuppressed = true; to disable the script in a page
      webBrowser1.Document.GetElementById("ElementId").SetAttribute("HTMLattrbute", "valueToBeSet");
  </code></pre>
  
  <p>Those are the main methods I have used to do what I wanted to.
  I have found this video useful: <a href="http://www.youtube.com/watch?v=5P2KvFN_aLY" rel="nofollow">http://www.youtube.com/watch?v=5P2KvFN_aLY</a></p>