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