我在运行时收到以下消息:
instapy: "Invalid Like Element!"
我的代码是
from instapy import InstaPy
insta_username = 'username'
insta_password = 'password'
session = InstaPy(username=insta_username, password=insta_password)
session.login()
session.set_delimit_commenting(enabled=True, max_comments=50000, min_comments=0)
session.set_do_comment(enabled=True, percentage=50)
session.set_comments(['comment1', 'comment2'])
session.like_by_tags(['tag1','tag2'], amount=40)
session.end()
我认为问题出在 InstaPy 的 xpath_compile.py 中。此时我的 xpath_compile 设置为:
`xpath["like_image"] = {
"like": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button[*[local-name()='svg']/@aria-label='Like']",
"unlike": "/html/body/div[1]/section/main/div/div/article/div[3]/section[1]/span[1]/button[*[local-name()='svg']/@aria-label='Unlike']",
}`
有任何想法吗?