title: Copy text from a table cell (td) with Selenium/Python
body: <p>Hi I'm very new to Selenium and would really appreciate help.</p>
  
  <p>I need to learn how to copy text, particularly from a table from a specific website: <a href="https://aca.tampagov.net/citizenaccess/Default.aspx#" rel="nofollow noreferrer">https://aca.tampagov.net/citizenaccess/Default.aspx#</a>
  (Go to url --> Search --> Building Permits --> click search button).</p>
  
  <p>You can finds a table at the bottom of the page.</p>
  
  <p>The first row in column "Record Type" has text "Commercial Utility Application". If I want to copy the text what I thought I should do is get the xpath which is </p>
  
  <pre><code>//*[@id="ctl00_PlaceHolderMain_dgvPermitList_gdvPermitList_ctl02_lblType"]
  </code></pre>
  
  <p>So I would have something like </p>
  
  <pre><code>driver.find_element_by_xpath('//*[@id="ctl00_PlaceHolderMain_dgvPermitList_gdvPermitList"]/tbody/tr[3]/td[4]').text()
  </code></pre>
  
  <p>But this gives me and error. What am I doing wrong here? And how would I be able to copy texts from such tables?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>So here's what I get:</p>
  
  <pre><code>Traceback (most recent call last):
  File "&lt;ipython-input-81-4e51d9229198&gt;", line 1, in &lt;module&gt;
  driver.find_element_by_xpath('//* [@id="ctl00_PlaceHolderMain_dgvPermitList_gdvPermitList"]/tbody/tr[3]/td[4]').text()
  
  
  File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 387, in find_element_by_xpath
  return self.find_element(by=By.XPATH, value=xpath)
  
  
  File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 957, in find_element
  'value': value})['value']
  
  
  File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 314, in execute
  self.error_handler.check_response(response)
  
  
  File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
  raise exception_class(message, screen, stacktrace)
  
  
  NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="ctl00_PlaceHolderMain_dgvPermitList_gdvPermitList"]/tbody/tr[3]/td[4]"}
  
  (Session info: chrome=67.0.3396.99)  (Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 10.0.17134 x86_64)
  </code></pre>