###############################################################################
# Web Scraping for stock prices
###############################################################################
import  requests

symbol = input("Enter a stock symbol: ")

symbol = symbol.upper( )

full_url = "https://www.marketwatch.com/investing/stock/" + symbol

response = requests.get(full_url)               #retrieve the web page

status  = response.status_code                  #status should be 200
page    = response.text                         #the page content

found 	= page.find("priceCurrency")            #find text that is near the price
start 	= found + 68                            #the stock price is where found + 68 char
end   	= found + 75                            #the stock price is 7 characters long

price = page[start : end]                       #take a the price

print(price)