title: How to get href link in Python Selenium
body: <p>I am new in Selenium and I am doing web scraping of a site, in that I want to get all href links of a tag.</p>
  
  <p>I used the below code but unable to get the href link. It displays <code>javascript:</code> as output.</p>
  
  <pre><code>driver.find_element_by_css_selector('div.clFx&gt;a').get_attribute('href')
  </code></pre>
  
  <p>In other code, this works fine but here it shows nothing, I am also attaching the image of the inspect element area where I want to fetch the href link.</p>
  
  <p>I have also checked some of the answers in Stack Overflow and used the same code still I am unable to get it.</p>
  
  <pre><code>&lt;div class="clFx"&gt;
  ::before
  &lt;a class="userName name" href="https://resdex.naukri.com/v2/preview/preview?uniqId=6f44e0e0b95503a44378054b64bdb1cc580e0f001e115d110418475f5808004f130d020214495f5e0b544e170d6&amp;amp;sid=3922138883&amp;amp;paramString=2faf4d57a73f0d419d15309cbc9f5f67134f5108084a5746754e034a571b2513445055524d51250c4b0a1f57504f54030c6&amp;amp;hfFlowName=search&amp;amp;commentSearchType=comment-my,comment-others" target="_blank"&gt;Bhimanagoud Patil&lt;/a&gt;
  ::after
  &lt;/div&gt;
  </code></pre>
  
  <p>The above href link I want to get it.</p>
  
  <p>I have included below the image of the inspect element:</p>
  
  <p><img src="https://i.stack.imgur.com/KrQfW.png" alt="enter image description here"></p>