title: Manipulating web pages with python
body: <p>My aim is to be able to automatically manipulate a web page with a script. Filling in information and selecting the correct drop down box. With minimal user input. </p>
  
  <p>So my example here I'm using the national rail website. </p>
  
  <pre><code>import win32com.client
  from time import sleep
  
  ie = win32com.client.Dispatch("InternetExplorer.Application")
  ie.Visible = 1
  ie.navigate("http://www.nationalrail.co.uk/")
  
  while ie.ReadyState != 4: # Wait for browser to finish loading
      sleep(1)
  print("Webpage Loaded")
  
  page = ie.Document
  
  links = page.links
  </code></pre>
  
  <p>If I wanted to change the box When "Leaving" to arriving, fill in the From "Station / Postcode" and hit Go. How would I go about doing this?</p>
  
  <p>Also is win32com the best method for manipulating webpages like this?</p>