sehuatang pdf 优化

This commit is contained in:
liuwei
2025-12-25 13:29:25 +08:00
parent 9381824cb2
commit 408bf12342
5 changed files with 24 additions and 7 deletions

View File

@@ -6,6 +6,11 @@ import mysql.connector
from mysql.connector import Error
from selenium.webdriver.common.by import By
import undetected_chromedriver as uc
if os.name == 'nt':
try:
uc.Chrome.__del__ = lambda self: None
except Exception:
pass
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from bs4 import BeautifulSoup

View File

@@ -3,6 +3,11 @@ import os
import requests
from io import BytesIO
import undetected_chromedriver as uc
if os.name == 'nt':
try:
uc.Chrome.__del__ = lambda self: None
except Exception:
pass
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
@@ -166,10 +171,10 @@ def fetch_and_create_pdf(url):
pass
def pdf_file_path():
def pdf_file_path_undetected():
url = 'https://www.sehuatang.net/forum.php?mod=forumdisplay&fid=103&filter=typeid&typeid=481'
return fetch_and_create_pdf(url)
if __name__ == "__main__":
pdf_file_path()
pdf_file_path_undetected()