Skip to content

Instantly share code, notes, and snippets.

@nnsnodnb
Last active January 22, 2024 11:27
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nnsnodnb/3d6782d1a5d9a141f21c to your computer and use it in GitHub Desktop.
Save nnsnodnb/3d6782d1a5d9a141f21c to your computer and use it in GitHub Desktop.
日経平均株価のリアルタイムページスクレイピング
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