Update: 初学记、佩文韵府 and 五车韵瑞
This commit is contained in:
27
五车韵瑞/test_shidian.py
Normal file
27
五车韵瑞/test_shidian.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import asyncio
|
||||
from playwright.async_api import async_playwright
|
||||
|
||||
async def main():
|
||||
async with async_playwright() as p:
|
||||
browser = await p.chromium.launch(headless=True)
|
||||
page = await browser.new_page()
|
||||
|
||||
# Intercept network requests
|
||||
async def log_response(response):
|
||||
try:
|
||||
if 'api/guji' in response.url or 'chapter' in response.url:
|
||||
text = await response.text()
|
||||
print(f"URL: {response.url}\nData: {text[:500]}\n")
|
||||
except:
|
||||
pass
|
||||
|
||||
page.on("response", log_response)
|
||||
|
||||
print("Navigating to shidianguji...")
|
||||
await page.goto("https://www.shidianguji.com/book/CADAL02059421/chapter/1lmkv0n02yhom?version=2", wait_until="networkidle")
|
||||
await page.wait_for_timeout(3000)
|
||||
|
||||
await browser.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user