Looking to scrape the last page link from the website? The usual requests and BeautifulSoup approach won't work here since the site loads its pagination dynamically through JavaScript. Here's how to solve it:
from selenium import webdriver
from selenium.webdriver.common.by import By
from bs4 import BeautifulSoup
driver = webdriver.Chrome()
driver.get("https://webtoon-tr.com/webtoon/")
# Wait for the element to load
last_page = driver.find_element(By.CSS_SELECTOR, "a.last")
href = last_page.get_attribute("href")
driver.quit()
This code uses Selenium which handles JavaScript-loaded content, unlike requests which only gets the initial HTML. Perfect for getting those daily comics recommendations. Let me know if you need help with Selenium setup or run into any issues!