This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python 3.4 | |
import urllib | |
import bs4 | |
def get_stock_price(name): | |
url = "https://www.google.com/finance" | |
req = urllib.request.Request(url) | |
url_full = url + "?" + urllib.parse.urlencode({"q": name}) | |
req = urllib.request.Request(url_full) |