Python retrieving value from URL
<p>I'm trying to write a python script that checks money.rediff.com for a particular stock price and prints it. I know that this can be done easily with their API, but I want to learn how urllib2 works, so I'm trying to do this the old fashioned way. But, I'm stuck on how to use the urllib. Many tutorials online asked me to the "Inspect element" of the value I need to return and split the string to get it. But, all the examples in the videos have the values with easily to split HTML Tags, but mine has it in something like this:</p>

<pre><code>&lt;div class="f16"&gt;
&lt;span id="ltpid" class="bold" style="color: rgb(0, 0, 0); background: rgb(255, 255, 255);"&gt;6.66&lt;/span&gt; &amp;nbsp; 
&lt;span id="change" class="green"&gt;+0.50&lt;/span&gt; &amp;nbsp; 

&lt;span id="ChangePercent" style="color: rgb(130, 130, 130); font-weight: normal;"&gt;+8.12%&lt;/span&gt;
&lt;/div&gt;
</code></pre>

<p>I only need the "6.66" in Line2 out. How do I go about doing this? I'm very very new to Urllib2 and Python. All help will be greatly appreciated. Thanks in advance.</p>

<p>Use BeautifulSoup instead of regex to parse HTML. </p>

python html urllib2