Spaces:
Build error
Build error
Download scraper.py from shach1995/streamlit_chatbot: direct link, hf CLI and curl.
- Browser
- Download file 337 Bytes
-
https://huggingface.co/spaces/shach1995/streamlit_chatbot/resolve/main/scraper.py
- Command line
-
hf download hf://spaces/shach1995/streamlit_chatbot/scraper.py
-
curl -L -o scraper.py https://huggingface.co/spaces/shach1995/streamlit_chatbot/resolve/main/scraper.py
337 Bytes
| 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 |