title: Extracting Data from a Table in HTML using Selenium and Python
body: <p>I have this assignment of extracting some items from each row of a table in HTML. I have figured out how to grab the whole table from the web using Selenium with Python. Following is the code for that:</p>
  
  <pre><code>from selenium import webdriver
  import time 
  import pandas as pd
  
  mydriver = webdriver.Chrome('C:/Program Files/chromedriver.exe')
  mydriver.get("https://www.bseindia.com/corporates/ann.aspx?expandable=0")
  
  time.sleep(5) # wait 5 seconds until DOM will load completly
  table = mydriver.find_element_by_xpath('//*[@id="ctl00_ContentPlaceHolder1_lblann"]/table/tbody')
  
  for row in table.find_elements_by_xpath('./tr'):
      print(row.text)
  </code></pre>
  
  <p>I am unable to understand the way I can grab specific items from the table itself. Following are the items that I require:</p>
  
  <ol>
  <li><p>Company Name</p></li>
  <li><p>PDF Link(if it does not exist, write "No PDF Link")</p></li>
  <li><p>Received Time</p></li>
  <li><p>Dessiminated Time</p></li>
  <li><p>Time Taken</p></li>
  <li><p>Description </p></li>
  </ol>
  
  <p>Any help in logic would be helpful.
  Thanks in Advance.</p>