title: How to extract links from a page using Beautiful soup
body: <p>I have a <a href="https://www.example.com/blog/author/abc" rel="nofollow noreferrer">HTML Page</a> with multiple divs like:</p>
  
  <pre><code>&lt;div class="post-info-wrap"&gt;
    &lt;h2 class="post-title"&gt;&lt;a href="https://www.example.com/blog/111/this-is-1st-post/" title="Example of 1st post &amp;#8211; Example 1 Post" rel="bookmark"&gt;sample post &amp;#8211; example 1 post&lt;/a&gt;&lt;/h2&gt;
    &lt;div class="post-meta clearfix"&gt;
  
      &lt;div class="post-info-wrap"&gt;
        &lt;h2 class="post-title"&gt;&lt;a href="https://www.example.com/blog/111/this-is-2nd-post/" title="Example of 2nd post &amp;#8211; Example 2 Post" rel="bookmark"&gt;sample post &amp;#8211; example 2 post&lt;/a&gt;&lt;/h2&gt;
        &lt;div class="post-meta clearfix"&gt;
  </code></pre>
  
  <p>and I need to get the  value for all the divs with class post-info-wrap I am new to BeautifulSoup</p>
  
  <p>so I need these urls:</p>
  
  <ul>
  <li><p><a href="https://www.example.com/blog/111/this-is-1st-post/" rel="nofollow noreferrer">https://www.example.com/blog/111/this-is-1st-post/</a></p></li>
  <li><p><a href="https://www.example.com/blog/111/this-is-2nd-post/" rel="nofollow noreferrer">https://www.example.com/blog/111/this-is-2nd-post/</a></p></li>
  <li><p>and so on... </p></li>
  </ul>
  
  <p>I have tried:</p>
  
  <pre><code>import re
  import requests
  from bs4 import BeautifulSoup
  
  r = requests.get("https://www.example.com/blog/author/abc") 
  data = r.content  # Content of response
  
  soup = BeautifulSoup(data, "html.parser")
  for link in soup.select('.post-info-wrap'):
     print link.find('a').attrs['href']
  </code></pre>
  
  <p>This code doesnt seem to be working. I am new to beautiful soup. How can i extract the links?</p>