I am new to Python and am trying to make a series of programs to text my phone the performance of stock market indices. I have a few programs working with limited functionality, and I believe they'd be improved if the data could be scraped from google, which I have not been able to do so far. The values I am trying to pull are at the top of the results page every time, almost in a table of some sort. At the bottom, I have a snip attached with the value I am trying to scrape.
Here is the portion of the code I have for the web scraping portion currently. I am using beautiful soup and requests.
import bs4
import requests
res = requests.get('https://www.google.com/search?safe=active&sxsrf=ALeKk00d7WrRTMvmhypG20E5MOEWpRwKlw%3A1601591747498&ei=w1l2X52DHoPatAXElILQDg&q=nasdaq+composite&oq=nasd&gs_lcp=CgZwc3ktYWIQAxgAMgwIIxAnEJ0CEEYQ-gEyBAgjECcyBAgjECcyCggAELEDEIMBEEMyCggAELEDEIMBEEMyCAgAELEDEIMBMgcIABCxAxBDMgcIABCxAxBDMgcIABCxAxBDMgoIABCxAxCDARBDOgQIABBHOgUIABCxAzoHCCMQ6gIQJzoHCCMQJxCdAjoECAAQQ1DszQ5Y9tkOYPjkDmgBcAJ4BYABqQOIAZ4NkgEJMS43LjEuMC4xmAEAoAEBqgEHZ3dzLXdperABCsgBCMABAQ&sclient=psy-ab')
type(res)
soup = bs4.BeautifulSoup(res.text,'lxml')
type(soup)
Current_Level = soup.find(class_='IsqQVc_NprOob_XcVN5d')
print (Current_Level)
The link leads to page if you googled "Nasdaq composite". The class I am using for soup.find() is aligned with the value when you right click - inspect the value on the web page.
Open to all solutions to get this value. Thanks for all of your help, greatly appreciated!