From f87c60e6dbc33ce249256205ca799f45e5a26b49 Mon Sep 17 00:00:00 2001 From: Feliciano Long Date: Fri, 13 May 2022 19:38:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DB=E7=AB=99=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit B站动态样式更改 1. card已变更为bili-dyn-list__item 2. 置顶消息变成了一个tag(此处存疑,暂未发现其他tag --- plugins/bilibili_sub/data_source.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/bilibili_sub/data_source.py b/plugins/bilibili_sub/data_source.py index abcfc7ded..111b0abeb 100755 --- a/plugins/bilibili_sub/data_source.py +++ b/plugins/bilibili_sub/data_source.py @@ -333,13 +333,13 @@ async def get_user_dynamic( # 删除置顶 await page.evaluate( """ - xs = document.getElementsByClassName('first-card-with-title'); + xs = document.getElementsByClassName('bili-dyn-item__tag'); for (x of xs) { - x.remove(); + x.parentNode.remove(); } """ ) - card = await page.query_selector(".card") + card = await page.query_selector(".bili-dyn-list__item") # 截图并保存 await card.screenshot( path=dynamic_path / f"{local_user.sub_id}_{dynamic_upload_time}.jpg", @@ -409,4 +409,4 @@ async def random_sub_data(self) -> Optional[BilibiliSub]: if sub: return sub await self.reload_sub_data() - return await self.random_sub_data() \ No newline at end of file + return await self.random_sub_data()