修复转发
All checks were successful
Update Code / StopService (windows-101.36.104.175) (push) Successful in 0s
Update Code / StopService (windows-101.36.102.136) (push) Successful in 0s
Update Code / CD (windows-101.36.102.136) (push) Successful in 8s
Update Code / CD (windows-101.36.104.175) (push) Successful in 12s

This commit is contained in:
work
2026-04-10 22:42:01 +08:00
parent faae5d3ba8
commit b0f854ebdb
2 changed files with 14 additions and 11 deletions

View File

@@ -635,17 +635,20 @@ def _get_share_config(target_url):
def _click_share_button(page, selector): def _click_share_button(page, selector):
locator = page.locator(selector) locator = page.locator(selector)
count = locator.count() deadline = time.time() + 120
for index in range(count): while time.time() < deadline:
candidate = locator.nth(index) count = locator.count()
try: for index in range(count):
if candidate.is_visible(): candidate = locator.nth(index)
candidate.scroll_into_view_if_needed(timeout=30000) try:
candidate.click(timeout=60000) if candidate.is_visible():
return candidate.scroll_into_view_if_needed(timeout=30000)
except Error: candidate.click(timeout=60000)
continue return
except Error:
continue
page.wait_for_timeout(1000)
element = page.query_selector(selector) element = page.query_selector(selector)
if element is None: if element is None:

View File

@@ -6,7 +6,7 @@ import spider.task as task_module
# 直接在这里填写测试参数 # 直接在这里填写测试参数
COOKIES = {"c_user":"61588267419224","datr":"3D2XaYqWJ1w9rJU6X6e02or_","fr":"0k8G2UtA1NqMJqD0s.AWemansED9s7o5tmbiUwA7gqAoWOk99OEJw8_zCrRks9IgULoSk.Bplz6g..AAA.0.0.Bplz6g.AWfaScT_l9g4id9lBpHtDtHo-T4","xs":"28:izkUxLXyFn_-OA:2:1771519655:-1:-1"} COOKIES = {"c_user":"61588333773832","datr":"HE2Wad2MttKeo5sq6N0H-Nzm","fr":"0EmS028gNHuZANcda.AWfAv-SGO_JSJHlIuvtEdOZckpo2Dpo2s5AFnk3pHsYvmEFUMRU.Bplk3I..AAA.0.0.Bplk3I.AWePI6kwlSPrrSIFkRyEX3BGU6Y","xs":"21:m9VOT0BnaXqORA:2:1771457996:-1:-1"}
TARGET_URL = "https://www.facebook.com/permalink.php?story_fbid=pfbid023QsxMBw26HAdt3LW1Ln7GUugWYbQkzfL9Ws68XUiuaXJvFD3u1iKtVFq7hpypdFtl&id=61580561183111" TARGET_URL = "https://www.facebook.com/permalink.php?story_fbid=pfbid023QsxMBw26HAdt3LW1Ln7GUugWYbQkzfL9Ws68XUiuaXJvFD3u1iKtVFq7hpypdFtl&id=61580561183111"