CnJaFlashC-1 / .python_history
OzoneAsai's picture
Upload .python_history with huggingface_hub
7b89807 verified
raw
history blame
793 Bytes
import asyncio
from playwright.async_api import async_playwright
async def fetch_train_info():
async with async_playwright() as p:
browser = await p.chromium.launch()
page = await browser.new_page()
# �y�[�W�ɃA�N�Z�X���AJavaScript�̎��s��҂�
await page.goto("https://traininfo.jreast.co.jp/train_info/kanto.aspx")
# �K�v�ɉ����Ďw�莞�ԑҋ@����i��: 5�b�ҋ@�j
await page.wait_for_timeout(5000)
# �^�s���̃e�L�X�g���擾
content = await page.content() # HTML�S�̂��擾
train_info = await page.inner_text("body") # �K�v�ȃZ���N�^���w�肵�Ď擾
print(train_info)
await browser.close()
# ���s
asyncio.run(fetch_train_info())
exit()