79432016

Date: 2025-02-12 05:18:54
Score: 1.5
Natty:
Report link

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!

Reasons:
  • Blacklisted phrase (1): how to solve
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: James78