以下の内容はhttps://blog.systemjp.net/entry/2023/07/05/093344より取得しました。


python 最初に見つかったxlsへのリンクを見つけてダウンロード

import requests
from bs4 import BeautifulSoup

# URL
url = "https://www.jpx.co.jp/listing/others/ex-rights/index.html"

# URLからHTMLを取得
response = requests.get(url)
html = response.text

# BeautifulSoupオブジェクトを作成
soup = BeautifulSoup(html, 'html.parser')

# 最初のxlsファイルのリンクを見つける
link = soup.find('a', href=lambda href: href and href.endswith('.xls'))

# ベースURL
base_url = 'https://www.jpx.co.jp'

# フルURLを作成
full_url = base_url + link['href']

# ファイルをダウンロード
response = requests.get(full_url)
with open('jpx_配当落権利落等情報.xls', 'wb') as f:
    f.write(response.content)



以上の内容はhttps://blog.systemjp.net/entry/2023/07/05/093344より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14