From 4a9f04c173d08528c6c3283fff615bd69f76dab6 Mon Sep 17 00:00:00 2001 From: fllesser Date: Sat, 11 Jan 2025 11:09:46 +0800 Subject: [PATCH] update pve.py --- nonebot_plugin_fortnite/pve.py | 66 +++++++++++++++++----------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/nonebot_plugin_fortnite/pve.py b/nonebot_plugin_fortnite/pve.py index 5917fcd..6d49cdd 100644 --- a/nonebot_plugin_fortnite/pve.py +++ b/nonebot_plugin_fortnite/pve.py @@ -1,9 +1,7 @@ import asyncio - from PIL import Image from pathlib import Path from playwright.async_api import async_playwright - from .config import data_dir vb_file = data_dir / "vb.png" @@ -16,17 +14,23 @@ async def screenshot_vb_img() -> Path: async with async_playwright() as p: browser = await p.chromium.launch(headless=True) page = await browser.new_page() - await page.goto(url) - # 截取第一个
+ await page.goto(url) + + # Check and screenshot the first
hot_info_1 = page.locator('div.hot-info').nth(0) - await hot_info_1.screenshot(path=data_dir / 'hot_info_1.png') - - # 截取