Merge pull request #159 from noahzark/patch-2

修复B站动态生成失败的问题
This commit is contained in:
HibiKier 2022-05-14 14:47:30 +08:00 committed by GitHub
commit 428481b2d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -333,13 +333,13 @@ async def get_user_dynamic(
# 删除置顶 # 删除置顶
await page.evaluate( await page.evaluate(
""" """
xs = document.getElementsByClassName('first-card-with-title'); xs = document.getElementsByClassName('bili-dyn-item__tag');
for (x of xs) { 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( await card.screenshot(
path=dynamic_path / f"{local_user.sub_id}_{dynamic_upload_time}.jpg", path=dynamic_path / f"{local_user.sub_id}_{dynamic_upload_time}.jpg",