import requests
import pandas as pd
from bs4 import BeautifulSoup
title_list=[]
#####
for i in range(10): #page 변환
response = requests.get(url)
#####
for j in range(4, 48): #span.title 값 추출
html = response.text
soup = BeautifulSoup(html, 'html.parser')
title = soup.select_one(f'body > div.root-container > div.content-wrapper.clearfix > article > div > div.article-list > div.list-table.table > a:nth-of-type({j}) > div.vrow-inner > div.vrow-top > span.vcol.col-title > span.title')
#####
for k in title: #insert into ~ values ~
title_list.append(title)
#####
col = ['post_list']
col = ['post_list']
post_list=list(title_list)
df = pd.DataFrame(post_list, columns=col)
3중 for 써서 저렇게 치니까 작동은 하는데 문제는 페이지가 넘어가질 않아서 한 개 페이지의 span.title 값들이 10번 반복되는레후 (예시: '종신주딱' '종신주딱'...'종신주딱')
반복문이 페이지를 제대로 넘겨서 3페이지, 4페이지,...n페이지의 타이틀을 찾을 수 있게 코드 수정을 도와달라는레후
#p{i+2}인 이유는 아카라이브의 HTML 구조상 p=1에서는 span.title의 nth-child가 14~58이지만 p>=2부터는 nth-child가 4~48이기 때문인레후