title: How can I find object with Selenium?
body: <p>Thats my code, I was changing, fixing, trying another modules, but still can not get a respond with my div text extracted. </p>
  
  <pre><code>import selenium 
  from selenium import webdriver
  
  driver = webdriver.Firefox() 
  driver.get('http://www.helloworld.com/')
  element = driver.find_element_by_id('main')
  
  WebElement = driver.findElement(By.xpath("//div[@class='main']"));
  webElement.getText();
  </code></pre>
  
  <p>I was trying with bs4 package but there is a big problem, becouse the data what i want is possible to get only when i am loged in on the website, and in bs4 respond was like from guest account, without login in. </p>
  
  <p>Here is a Traceback what i got usint that code with Selenium:</p>
  
  <pre><code>Traceback (most recent call last):
    File "D:/Python27/get text value div.py", line 8, in &lt;module&gt;
      WebElement = driver.findElement(By.xpath("//div[@class='main']"));
  AttributeError: 'WebDriver' object has no attribute 'findElement'
  </code></pre>
  
  <p>Aftter a small fix, I am using this: </p>
  
  <pre><code>import selenium 
  from selenium import webdriver
  
  driver = webdriver.Firefox() 
  driver.get('http://www.helloworld.com/')
  element = driver.find_element_by_id('main')
  main_text = element.text
  </code></pre>
  
  <p>The respond after <code>print element.text</code> in shell is: </p>
  
  <p>Traceback (most recent call last):</p>
  
  <pre><code>  File "&lt;pyshell#20&gt;", line 1, in &lt;module&gt;
      element.text
    File "D:\Python27\lib\selenium\webdriver\remote\webelement.py", line 50, in text
      return self._execute(Command.GET_ELEMENT_TEXT)['value']
    File "D:\Python27\lib\selenium\webdriver\remote\webelement.py", line 228, in _execute
      return self._parent.execute(command, params)
    File "D:\Python27\lib\selenium\webdriver\remote\webdriver.py", line 165, in execute
      self.error_handler.check_response(response)
    File "D:\Python27\lib\selenium\webdriver\remote\errorhandler.py", line 152, in check_response
      raise exception_class(message, screen, stacktrace)
  WebDriverException: Message: u'\'[JavaScript Error: "a is null" {file: "file:///c:/dokume~1/tomek/lokale%20einstellungen/temp/tmpupvgr2/extensions/fxdriver@googlecode.com/components/command_processor.js" line: 7623}]\' when calling method: [nsICommandProcessor::execute]' 
  </code></pre>