title: How to locate links from Google results
body: <p>Scenario:</p>
  
  <ol>
  <li>open "google.co.in". </li>
  <li>click in the search input box. </li>
  <li>type something. </li>
  <li>click Enter.</li>
  <li>get the text of all links.</li>
  </ol>
  
  <p>The xpaths of some links are: </p>
  
  <ul>
  <li><code>.//*[@id='rso']/div[2]/div/div[2]/div/div/h3/a</code></li>
  <li><code>.//*[@id='rso']/div[2]/div/div[3]/div/div/h3/a</code></li>
  <li><code>.//*[@id='rso']/div[2]/div/div[4]/div/div/h3/a</code></li>
  <li><code>.//*[@id='rso']/div[2]/div/div[5]/div/div/h3/a</code></li>
  <li><code>.//*[@id='rso']/div[2]/div/div[6]/div/div/h3/a</code></li>
  </ul>
  
  <p>All the xpaths have the same pattern. the third div needs to be incremented by 1 to get the next xpath. I've read somewhere that in the scenarios like this generic xpath can be used. According to his suggestion, the xpath will be <code>".//*[@id='rso']/div[2]/div/div/div/div/h3/a"</code>. just removed the predicate of the third div. This is not working. Is this the way to locate elements?</p>