title: Python & Selenium Click and "TypeError: string indices must be integers"
body: <p>I am currently working on a piece of code and have done many readings using the documentary and looked at many examples, but still I cannot fix my bug. I am using Python and Selenium Webdriver.</p>
  
  <p>Here's the problem: I am trying to extract an image from an HTML page that uses Javascript. The results from the function call are displayed (in firefox) once I use the selenium webdriver, but I cannot click on a number at the bottom of the page to go onto the 3rd or 4th page.</p>
  
  <p>Here is the HTML code that I am having issues with:</p>
  
  <pre><code>&lt;div class="pagebook" data-reactid=".1.0.2.0"&gt;&lt;div style="display:none;" data-reactid=".1.0.2.0.0"&gt;&lt;/div&gt;&lt;div class="active" data-reactid=".1.0.2.0.1:$0"&gt;1&lt;/div&gt;&lt;div class="" data-reactid=".1.0.2.0.1:$1"&gt;2&lt;/div&gt;&lt;div class="" data-reactid=".1.0.2.0.1:$2"&gt;3&lt;/div&gt;&lt;div class="" data-reactid=".1.0.2.0.1:$3"&gt;4&lt;/div&gt;&lt;div class="" data-reactid=".1.0.2.0.1:$4"&gt;5&lt;/div&gt;&lt;div class="" dat&lt;div class="next" style="margin-right:20px;" data-reactid=".1.0.2.0.$6"&gt;►&lt;/div&gt;&lt;/div&gt;
  </code></pre>
  
  <p>I did this call using xpath capability: <code>browser.find_element_by_xpath('//div[@data-reactid=".1.0.2.0.1:$2"]').click()</code></p>
  
  <p>The first time I did this it worked a few times and then it gave me an error and I could never use it again. The error was: </p>
  
  <pre><code>File "C:\Python27\Lib\site-packages\selenium-2.49.2-py2.7.egg\selenium\webdriver\remote\errorhandler.py", line 111, in check_response
      message = value["value"]["message"]
  TypeError: string indices must be integers
  </code></pre>
  
  <p>Here is the code that I am using:</p>
  
  <pre><code>browser = webdriver.Firefox()
  browser.implicitly_wait(5) #backup wait of 5 seconds just in case
  browser.get(url2)
  browser.find_element_by_xpath('//div[@data-reactid=".1.0.2.0.1:$2"]').click()
  </code></pre>
  
  <p>What I am looking for help with:</p>
  
  <ol>
  <li>The error</li>
  <li>Using a different function for clicking</li>
  </ol>
  
  <p>Appreciate it!</p>