增加点赞永久的格式类型
This commit is contained in:
@@ -853,8 +853,8 @@ def playwright_like(cookies, target_url):
|
||||
if 'permalink.php?story_fbid' in target_url or '/posts/' in target_url:
|
||||
# 文字或图片类型
|
||||
button_xpath = '//div[@class="__fb-light-mode x1n2onr6 x1vjfegm"]//span[@data-ad-rendering-role="like_button"]'
|
||||
elif 'watch/?v' in target_url or '/videos/' in target_url:
|
||||
# 视频类型
|
||||
elif 'watch/?v' in target_url or '/videos/' in target_url or '/permalink/' in target_url:
|
||||
# 视频类型, 视频类型, 永久链接
|
||||
button_xpath = '//span[@data-ad-rendering-role="like_button"][1]'
|
||||
elif '/reel/' in target_url:
|
||||
# 短视频类型
|
||||
@@ -957,7 +957,7 @@ def playwright_comment(cookies, target_url, content, image_key=None):
|
||||
page.goto(target_url)
|
||||
sleep(1, 2)
|
||||
|
||||
if 'permalink.php?story_fbid' in target_url or '/posts/' in target_url:
|
||||
if 'permalink.php?story_fbid' in target_url or '/posts/' in target_url or "/permalink/" in target_url:
|
||||
# 文字或图片类型
|
||||
input_xpath = '//div[@aria-label="Write a comment…"]'
|
||||
attach_xpath = '//div[@id="focused-state-actions-list"]//div[@aria-label="Attach a photo or video"]'
|
||||
@@ -1279,7 +1279,8 @@ if __name__ == '__main__':
|
||||
# # image_key='rg.jpg'
|
||||
# )
|
||||
cookies = '{"c_user":"61565405263653","datr":"-YDhZoLWu5zbUIw5cOB2In9s","fr":"0ZmsqLWbmV0Onlspt.AWW1JRfVxQAF-jl0oGY7lBQLYq4.Bm4YD5..AAA.0.0.Bm4YED.AWVf1ae03r4","m_page_voice":"61565405263653","m_pixel_ratio":"2.625","sb":"-YDhZs8LozUoyLe1gj2MCUwW","wd":"412x759","xs":"21%3A8Gt3CwtjVWJUhQ%3A2%3A1726054660%3A-1%3A-1"}'
|
||||
print(playwright_check_account_cookies(cookies))
|
||||
# print(playwright_check_account_cookies(cookies))
|
||||
print(playwright_comment(cookies, "https://www.facebook.com/groups/1564190847667055/posts/1918780732208063/", "wow"))
|
||||
# cookies = playwright_login('61575975148121', 'Mu1711rstu1999', 'JNCCTXB34EP5ME6RU6RND6SHBQ6KATAR')
|
||||
# print(cookies)
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user