<jupyter_start><jupyter_text>1.HTML 불러오기        - Browser와 같은 동작 : Selenium2.CSS Selector 선택(최소까지)        - Tag 형식 줄임 : 태그, 속성(attribute), Text3.저장(Excel)    - Pandas DataFrame<jupyter_code>from selenium import webdriver
browser = webdriver.Chrome('./chromedriver.exe')
browser.get('http://ticket.interpark.com/Contents/Ranking?smid1=s_menu&smid2=performance')
html = browser.page_source
from bs4 import BeautifulSoup as bs
soup = bs(html, 'html.parser')
n = soup.select('a.prdName')
d = soup.select('a.prdDuration')
len(n), len(d), type(n), type(d)
n[0], d[0]
n[0].text, d[0].text<jupyter_output><empty_output><jupyter_text>두 개 파일을 각각 따로 dataFrame화하고 Merge하기<jupyter_code>contents_n = []
for i in n:
    a = i.text.strip()
    contents_n.append(a)
contents_n
contents_d = []
for i in d:
    b = i.text.strip()
    contents_d.append(b)
contents_d<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14726027397260275, 'fraction_numerical': 0.01141552511415525, 'mean_word_length': 4.925675675675675, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '37360', 'license': 'Apache-2.0', 'n_tokens_mistral': 385, 'n_tokens_neox': 408, 'n_words': 68, 'path': 'interpark_selenium.ipynb', 'repo_name': 'tecktonik08/test_webscraping', 'size': '876'}