Skip to content

Instantly share code, notes, and snippets.

@nnsnodnb
Last active Mar 20, 2022
Embed
What would you like to do?
日経平均株価のリアルタイムページスクレイピング
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