Spaces:
Sleeping
Sleeping
from bs4 import BeautifulSoup | |
import requests | |
def get_stock_info(stock_code): | |
url = f"https://www.nikkei.com/nkd/company/?scode={stock_code}" | |
r = requests.get(url) | |
soup = BeautifulSoup(r.content, 'html.parser') | |
_text = soup.find('div', attrs={'class': 'm-stockInfo_top_left'}) | |
content = _text.text | |
return content |