import pandas as pd
import requests
from bs4 import BeautifulSoup
from tabulate import tabulate
import time
url = "http://comp.fnguide.com/SVO2/ASP/SVD_Main.asp?
pGB=1&gicode=A005930&cID=&MenuYn=Y&ReportGB=&NewMenuID=101&stkGb=701"
res = requests.get(url)
soup = BeautifulSoup(res.content, "lxml")
table = soup.find_all("table")
df = pd.read_html(str(table))
print(tabulate(df[0], headers="keys", tablefmt="psql"))
재표제표 데이터를 얻기 위해서 위와 같은 코드를 짜게 되었습니다.
제 다음 단계 목표는 프린트에서 나오는 내용 중에 '발행주식수(보통주/우선주)'라는 내용만 가져오고 싶은건데요(행 전체가 아니라 이 부분만요)
어떻게 코드를 짜야 하나요?
혹시 tabulate가 불편하다면, 다른 방법은 없을까요?