From 02c4d58d8e65d98dad8509376239d138eb7b0609 Mon Sep 17 00:00:00 2001 From: Ayuriel Date: Mon, 27 Jan 2025 23:56:34 +0900 Subject: [PATCH] =?UTF-8?q?feat:=208.2=EC=9E=A5=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=9E=98=ED=95=91=20=EC=83=98=ED=94=8C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/8-2-scrape.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 example/8-2-scrape.py diff --git a/example/8-2-scrape.py b/example/8-2-scrape.py new file mode 100644 index 0000000..383fa0d --- /dev/null +++ b/example/8-2-scrape.py @@ -0,0 +1,24 @@ +import requests as rq +from bs4 import BeautifulSoup +import pandas as pd + +url = 'https://kind.krx.co.kr/disclosure/todaydisclosure.do' +payload = { + 'method': 'searchTodayDisclosureSub', + 'currentPageSize': '15', + 'pageIndex': '1', + 'orderMode': '0', + 'orderStat': 'D', + 'forward': 'todaydisclosure_sub', + 'chose': 'S', + 'todayFlag': 'N', + 'selDate': '2025-01-24' +} + +data = rq.post(url, data=payload) +html = BeautifulSoup(data.content, 'html.parser') + +html_unicode = html.prettify() +tbl = pd.read_html(html_unicode) + +print(tbl[0].head()) \ No newline at end of file