<jupyter_start><jupyter_text>다시, 전체 페이지 크롤링하기<jupyter_code>import time
from selenium import webdriver
import re
import pandas as pd

id1 = ['1448208']

dt = []
dd = []



for j in range(len(id1[:1])):
  print(j,'실행중')
  url = 'https://kebhana.com/cont/mall/mall08/mall0802/mall080206/'+id1[j]+'_131044.jsp?_menuNo=98786'

  time.sleep(0.3)
    



  driver.get(url)
  time.sleep(1)
  names = driver.find_elements_by_xpath('//*[@id="contents"]/div[2]/h3')

  adt = driver.find_elements_by_css_selector('#contents > div.mall-detail-content > dl > dt')
  add = driver.find_elements_by_css_selector('#contents > div.mall-detail-content > dl > dd')

  id2.append(id1[j])



  p = re.compile('[^1-9 ㄱ-ㅣ가-힣 ( \n]+')


  for i in adt:
    dt.append(i.text)

  dt.append('대출명')


  for i in add:
  
    dd.append(i.text)

  for i in names:
    dd.append(i.text.split("\n")[0])


df=pd.DataFrame(dd)
df=df.T
df.columns=dt
df


#id1 = ['1448214', '1448217', '1448218', '1448219', '1448223', '1448164', '1448163', '1448162', '1448161', '1448208', '1448214', '1448217', '1448218', '1448219', '1448223', '1448164', '1448163', '1448162', '1448161', '1448208', '1448214', '1448217', '1448218', '1448219', '1448223', '1448164', '1448163', '1448162', '1448161', '1448208', '1448214', '1448217', '1448218', '1448219', '1448223', '1448164', '1448163', '1448162', '1448161']
id1 = ['1448214', '1448217', '1448218', '1448219', '1448223', '1448164', '1448163', '1448162', '1448161', '1448160', '1448159', '1448155', '1448154', '1448153', '1448152', '1447431', '1450483', '1450484', '1443595', '1459714', '1459715', '1459717', '1459722', '1443580', '1459713', '1461180', '1461179', '1461177', '1461176', '1461175', '1461174', '1466310', '1461172', '1461171', '1461166', '1461158', '1461157', '1461156', '1463642']



for j in range(len(id1)):
  print(j,'실행중')
  url = 'https://kebhana.com/cont/mall/mall08/mall0802/mall080206/'+id1[j]+'_131044.jsp?_menuNo=98786'
  dt = []
  dd = []
  name = []

  time.sleep(0.3)
    



  driver.get(url)
  time.sleep(1)
  names = driver.find_elements_by_xpath('//*[@id="contents"]/div[2]/h3')

  adt = driver.find_elements_by_css_selector('#contents > div.mall-detail-content > dl > dt')
  add = driver.find_elements_by_css_selector('#contents > div.mall-detail-content > dl > dd')

  id2.append(id1[j])



  p = re.compile('[^1-9 ㄱ-ㅣ가-힣 ( \n]+')


  for i in adt:
    dt.append(i.text)

  dt.append('대출명')


  for i in add:
  
    dd.append(i.text)

  for i in names:
    dd.append(i.text.split("\n")[0])


  df2=pd.DataFrame(dd)
  df2=df2.T
  df2.columns=dt
  df= pd.concat([df, df2])
df
df.to_excel('대출상품_v2.xlsx', encoding='euc-kr')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.21545929798356983, 'fraction_numerical': 0.23637042569081404, 'mean_word_length': 4.512345679012346, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 2, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '296841', 'license': 'MIT', 'n_tokens_mistral': 1607, 'n_tokens_neox': 1250, 'n_words': 201, 'path': 'data_extraction/.ipynb_checkpoints/Untitled-checkpoint.ipynb', 'repo_name': 'LeenaKim/Business_Loan_Platform_Project', 'size': '2678'}