
import requests
from bs4 import BeautifulSoup
URL = "https://www.shinhancard.com/pconts/html/card/apply/credit/1196302_2207.html" # 카드 상세 정보 페이지
headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36'}
data = requests.get(URL, headers=headers)
soup = BeautifulSoup(data.text, 'html.parser')
so = soup.select_one('#cardCompareAfter > div.card_detail.gap80_40 > div.card_name_wrap > h1') # <h1 class="hidden-text">카카오뱅크 신한카드</h1> 에 대한 copy selector를 한 것
print(so.text) # 결과:
ì¹´ì¹´ì
í¬ ì íì¹´ë
어떻게 해야 가져올 수 있나요 ㅠㅠ..
