Last active
January 22, 2024 11:27
-
-
Save nnsnodnb/3d6782d1a5d9a141f21c to your computer and use it in GitHub Desktop.
日経平均株価のリアルタイムページスクレイピング
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.request import urlopen | |
from bs4 import BeautifulSoup | |
html = urlopen('http://nikkei225jp.com/chart/') | |
soup = BeautifulSoup(html , "html.parser") | |
nikkei = soup.find('div' , class_ = 'if_cur') | |
price = nikkei.string | |
print(price) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment