Google search scrapper , Python
<p>I am new to Python and trying to make a Google search scrapper for the purpose of getting stock prices , but I run my code below I dont get any results instead I am getting the page HTML formatting.</p>

<pre><code>import urllib.request
from bs4 import BeautifulSoup

import requests

url = 'https://www.google.com/webhp?sourceid=chrome-instant&amp;ion=1&amp;espv=2&amp;ie=UTF-8#q=uwti'
response = requests.get(url)
html = response.content

soup = BeautifulSoup(html, "html.parser")

print(soup.prettify())
</code></pre>

<p>Am I missing something very simple , please give me some pointers on this . I am trying to extract the current stock value.How do I extract this value in the attached image ?</p>

<p><a href="https://i.stack.imgur.com/BSfxl.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/BSfxl.jpg" alt="enter image description here"></a></p>

<p>Like @Jeff mentioned, this kind of tasks are easier to handle by APIs rather than scrapping web pages.</p>

<p>Here is a solution using Yahoo Finance API</p>

<pre><code>import urllib2
response = urllib2.urlopen('http://finance.yahoo.com/d/quotes.csv?s=UWTI&amp;f=sa')
print response.read()
</code></pre>

<p>Output:</p>

<pre><code>"UWTI",27.40
</code></pre>

<p>You can fine tune the returned data by changing the format string(eg:f=sab2)
Here is the details on the <a href="http://www.jarloo.com/yahoo_finance/" rel="nofollow">API</a></p>

python parsing beautifulsoup urllib