title: Accessing a specific html tag via css
body: <p>My html code is as below..</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;div class="main"&gt;
  &lt;div class="sub1"&gt;
  &lt;p&gt;&lt;a href="http://uselesslink1"&gt;&lt;/a&gt;&lt;/p&gt;
  &lt;p&gt;&lt;a href="http://uselesslink2"&gt;&lt;/a&gt;&lt;/p&gt;
  &lt;/div&gt;
  &lt;div class="sub2"&gt;
  &lt;/div&gt;
  &lt;p&gt;&lt;a href="http://usefullink1"&gt;&lt;/a&gt;
  &lt;a href="http://usefullink2"&gt;&lt;/a&gt;
  &lt;/p&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I need to access the useful links <a href="http://usefullink1" rel="nofollow noreferrer">http://usefullink1</a> and <a href="http://usefullink2" rel="nofollow noreferrer">http://usefullink2</a> using css selectors and use </p>
  
  <blockquote>
    <p>.main p a</p>
  </blockquote>
  
  <p>But doing this I'm able to access both useful links and also the useless links which are inside the div sub1 inside div main.</p>
  
  <p>With the above html structure is it possible to access only the usefull links and not the useless ones using css.</p>
  
  <p>All help is sincerely appreciated.</p>
  
  <p>Thanks</p>