<jupyter_start><jupyter_text>Practices<jupyter_code>df = pd.read_csv("links.csv")
df["0"]
li = list(df["0"])
li[33]
base = []

for i in range(len(li)):
    driver = webdriver.Chrome(r'C:\Users\USER\chromedriver_win32\chromedriver.exe')  
    url = li[i]
    driver.get(url)
    elem = driver.find_element_by_xpath("//*")
    source_code = elem.get_attribute("outerHTML")
    alink = driver.find_element_by_xpath("/html/body/div[1]/div/div/div[4]/div[1]/div[1]/div/a")
    print(alink)
    base.append(alink.get_attribute('href'))
    print(base)
    driver.quit()
#      soup = BeautifulSoup(source_code, 'html.parser')
base<jupyter_output><empty_output><jupyter_text>testing<jupyter_code>df = pd.read_csv("links.csv")
df["0"]
li = list(df["0"])
li[3]
driver = webdriver.Chrome(r'C:\Users\USER\chromedriver_win32\chromedriver.exe')  
base = []  
url = li[2]
driver.get(url)
elem = driver.find_element_by_xpath("//*")
source_code = elem.get_attribute("outerHTML")
soup = BeautifulSoup(source_code, 'html.parser')
dir(driver)
title = soup.find_all('div', class_="titleSection--1lnfz")
title
len(title)
c = []
for j in title:
    c.append(j.find_all("a", class_='titleLink--2BV8L'))
c
eee = []
for e in c:
    for ee in e:
        eee.append(ee)
        
for each in eee:
    if "sortType=TIME" in each.attrs['href']:
        print(each.attrs['href'])        
for each in eee:
    if "sortType=TIME" in each.attrs['href']:
        print('ok')

clist = []
for cc in c:
    if len(cc) == 0:
        continue
    else:
        clist.append(cc)
clist
base = 'm.kin.naver.com'

clist = []
for cc in c:
    if len(cc) != 0:
        clist.append(cc)

clist
for ji in clist:
    ji.find_all('a')
for ii in clist[0]:
    print(base + ii.get('href'))<jupyter_output><empty_output><jupyter_text>Testing testing<jupyter_code># importing the required modules
import requests
from bs4 import BeautifulSoup
import pandas as pd
from selenium import webdriver

df = pd.read_csv("links.csv")
df["0"]
li = list(df["0"])
li[]
b_url = 'm.kin.naver.com'
base = []
c = []
clist = []


for i in range(3):
    driver = webdriver.Chrome(r'C:\Users\USER\chromedriver_win32\chromedriver.exe')  
    url = li[i]
    driver.get(url)
    elem = driver.find_element_by_xpath("//*")
    source_code = elem.get_attribute("outerHTML")
    soup = BeautifulSoup(source_code, 'html.parser')
    title = soup.find_all('div', class_="titleSection--1lnfz")

    for j in title:
        c.append(j.find_all("a", class_='titleLink--2BV8L'))
    eee = []
    for e in c:
        for ee in e:
            eee.append(ee)

    for each in eee:
        if "sortType=TIME" in each.attrs['href']:
            if b_url+each.attrs['href'] not in base:
                base.append(b_url+each.attrs['href'])
        
    driver.quit()
base
   
#     for cc in c:
#         if len(cc) != 0:
#             clist.append(cc)
                
#     for ii in clist[0]:
#         print(base + ii.get('href'))

taa = ta.find_all('a')
print(taa)
alink = driver.find_element_by_xpath("//html/body/div[1]/div/div/div[4]/div[1]/div[1]/div/a")
link = alink.get_attribute('href')
link
new_url = ta[-1].get('href')
base.append("m.kin.naver.com/" + new_url)
time.sleep(2)

pp = []
for p in range(len(tdiv)):
    #     pp.append(tdiv[p])
    pp.append(tdiv[p].find_all('a', class_ = "titleLink--2BV8L"))
pp[-2].get("href")
pp.find('a', class_ = "titleLink--2BV8L")
pp
 a = driver.find_element_by_xpath("//*/div/div[1]/div/div[1]/div[2]/div[1]/div/a[5]").click()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1779420125071063, 'fraction_numerical': 0.013928368391131325, 'mean_word_length': 3.349814585908529, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '540101', 'license': 'Apache-2.0', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1397, 'n_words': 249, 'path': 'Project01/Link_ETL/Intermediate_link_extraction.ipynb', 'repo_name': 'nayeem990/Korean-website-scraping', 'size': '3518'}