title: Unable to run python selenium webdriver scripts over Amazon EC2
body: <p>I am trying to run a python script in which I am opening a webpage and clicking on some element. But the script is running very slow and giving random exceptions . </p>
  
  <p>Mostly it halts at line
  driver = webdriver.Firefox()</p>
  
  <p>Message -</p>
  
  <blockquote>
    <p>selenium.common.exceptions.WebDriverException: Message: 'Can\'t load the profile. Profile ?Dir: /tmp/tmp4liaEq Firefox output: Xlib:  extension "RANDR" missing on display ":1733".\n1403086712970\taddons.xpi\tDEBUG\tstartup\n1403086713204\taddons.xpi\tDEBUG\tcheckForChanges\n1403086713568\taddons.xpi\tDEBUG\tNo changes found\n'</p>
  </blockquote>
  
  <p>Sometimes - 
  <code>driver.find_element_by_xpath("//a[@id='some_id']")</code>
  Returning error that the element is not visible so can't be clicked.</p>
  
  <p>The same script runs smoothly on my system that has 4GB RAM.
  (EC2 system specs ~ 600mb memory)</p>
  
  <p>I tried looking into the system and "top" command returned -</p>
  
  <p><code>604332k total,   577412k used,    26920k free,     6616k buffers</code></p>
  
  <p>I have installed firefox and also xvfb since i am running the firefox headlessly</p>