title: Selenium getting value by skipping a tag in between
body: <h1>This is from Redbus.in website</h1>
  <p>What i want to do is extract the travels list and store it in list..but I cant get the exact value from this.</p>
  <pre><code>&lt;div id=&quot;t1-trvDiv&quot; class=&quot;trvDiv&quot; style=&quot;display: block;&quot;&gt; 
     &lt;ul id=&quot;t1-travListing&quot; class=&quot;ul-listing&quot;&gt;
       &lt;li id=&quot;t1-travls-0&quot;&gt;
       &lt;li id=&quot;t1-travls-1&quot;&gt;
         &lt;a title=&quot;National Travels&quot; title1=&quot;1&quot; onclick=&quot;bindTrav(&quot;t1&quot;,1);&quot;&gt;
           &lt;span class=&quot;tickSelected&quot;&gt;&lt;/span&gt;
           National Travels
         &lt;/a&gt;
       &lt;/li&gt;
       &lt;li id=&quot;t1-travls-2&quot;&gt;
         &lt;a title=&quot;Seabird Tourists&quot; title1=&quot;2&quot; onclick=&quot;bindTrav(&quot;t1&quot;,2);&quot;&gt;
           &lt;span class=&quot;tickSelected&quot;&gt;&lt;/span&gt;
           Seabird Tourists
         &lt;/a&gt;
       &lt;/li&gt;
       &lt;li id=&quot;t1-travls-3&quot;&gt;
         ...
       &lt;/li&gt;
  </code></pre>
  <p>This is the java code I used to at least print the first value..</p>
  <pre><code>List&lt;WebElement&gt; allElements = driver.findElements(By.xpath(&quot;//ul[@id='t1-travListing']/li&quot;));
  int i=0;
  allElements.remove(allElements.size()-1);
  for (WebElement element: allElements) {
      System.out.println(driver.findElement(By.xpath(&quot;//li[@id='t1-travls-0']/a/&quot;)).getText());        
  }
  </code></pre>
  <p>As there is span tag after  tag i don't know how to skip that and get value from that</p>