How to find and extract link from webpage?
<p>I have website , e.g <code>http://site.com</code></p>

<p>I would like fetch main page and extract only links that match the regular expression, e.g <code>.*somepage.*</code></p>

<p>The format of links in html code can be:</p>

<pre><code>&lt;a href="http://site.com/my-somepage"&gt;url&lt;/a&gt; 
&lt;a href="/my-somepage.html"&gt;url&lt;/a&gt; 
&lt;a href="my-somepage.htm"&gt;url&lt;/a&gt;
</code></pre>

<p>I need the output format:</p>

<pre><code>http://site.com/my-somepage
http://site.com/my-somepage.html
http://site.com/my-somepage.htm
</code></pre>

<p>Output url must contain domain name always. </p>

<p>What is the fast python solution for this?</p>
