Is there a better way to webscrape MSFT data in shorter lines? I have tried it already but get the issue 'module' object is not callable

38 views Asked by At

tried following the same method, didnt work out

import bs4
import requests
from bs4 import BeautifulSoup
import urllib.request

#data I want to pull then push a while loop to get it regularly by the minute
r = requests.get('https://finance.yahoo.com/quote/MSFT?p=MSFT&.tsrc=fin-srch') 
soup = BeautifulSoup(r.text, 'xml')
print(soup)
1

There are 1 answers

0
Gokhan Atil On

Please check the documentation:

https://www.crummy.com/software/BeautifulSoup/bs4/doc/

You need to call a function of soup object. For example:

print(soup.get_text())