我是 Python、PIP 和 InstaPy 的新手。
我正在尝试创建一个程序,该程序将喜欢属于特定用户的所有帖子。
这是我到目前为止所写的:
""" Quickstart script for InstaPy usage """
# imports
from instapy import InstaPy
from instapy import smart_run
# login credentials
insta_username = 'my_insta_username' # <- enter username here
insta_password = 'my_insta_password' # <- enter password here
# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=False)
with smart_run(session):
""" Activity flow """
# general settings
session.set_relationship_bounds(enabled=True,
delimit_by_numbers=True,
max_followers=600,
min_followers=100,
min_following=77)
session.set_dont_include(["friend1", "friend2", "friend3"])
session.set_do_like(True, percentage=100)
session.interact_by_users(['some_username'], media='None')
但问题是它忽略了几乎所有的帖子some_username
,只sessions.set_do_like
对部分帖子执行功能。
这是我的console
输出:
INFO [2020-06-25 18:15:48] [my_insta_username] -- Connection Checklist [1/3] (Internet Connection Status)
INFO [2020-06-25 18:15:51] [my_insta_username] - Internet Connection Status: ok
INFO [2020-06-25 18:15:51] [my_insta_username] - Current IP is "120.57.14.16" and it's from "India/IN"
INFO [2020-06-25 18:15:51] [my_insta_username] -- Connection Checklist [2/3] (Instagram Server Status)
INFO [2020-06-25 18:16:10] [my_insta_username] - Instagram WebSite Status: Currently Up
INFO [2020-06-25 18:16:10] [my_insta_username] - Instagram Response Time: 98.113 ms
INFO [2020-06-25 18:16:10] [my_insta_username] - Instagram Reponse Code: 200
INFO [2020-06-25 18:16:10] [my_insta_username] - Instagram Server Status: ok
INFO [2020-06-25 18:16:10] [my_insta_username] -- Connection Checklist [3/3] (Hide Selenium Extension)
INFO [2020-06-25 18:16:10] [my_insta_username] - window.navigator.webdriver response: False
INFO [2020-06-25 18:16:10] [my_insta_username] - Hide Selenium Extension: ok
................................................................................
INFO [2020-06-25 18:16:30] [my_insta_username] Logged in successfully!
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
INFO [2020-06-25 18:16:30] [my_insta_username] Saving account progress...
________________________________________________________________________________________
INFO [2020-06-25 18:16:51] [my_insta_username] Starting to interact by users..
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
INFO [2020-06-25 18:16:51] [my_insta_username] Username [1/1]
INFO [2020-06-25 18:16:51] [my_insta_username] --> b'some_username'
INFO [2020-06-25 18:16:56] [my_insta_username] User: 'some_username' |> followers: 139 |> following: 114 |> relationship ratio: 1.21
INFO [2020-06-25 18:17:21] [my_insta_username] username actions: following=False commenting=False liking=True story=False
INFO [2020-06-25 18:17:21] [my_insta_username] Getting some_username image list...
ERROR [2020-06-25 18:17:49] [my_insta_username] link_elems error local variable 'post_href' referenced before assignment
INFO [2020-06-25 18:18:10] [my_insta_username] There are possibly less posts than 10 in some_username's profile page!
INFO [2020-06-25 18:18:10] [my_insta_username] --> Not following
INFO [2020-06-25 18:18:11] [my_insta_username] -------------
INFO [2020-06-25 18:18:11] [my_insta_username] --> Given amount not fullfilled, image pool reached its end
INFO [2020-06-25 18:18:12] [my_insta_username] Sessional Live Report:
|> No any statistics to show
[Session lasted 2.59 minutes]
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
INFO [2020-06-25 18:18:12] [my_insta_username] Session ended!
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
我该如何解决?
我的系统:
操作系统:Windows 10
Python:3.8.3
PIP:20.1.1
InstaPy:0.6.8
提前感谢您的时间和帮助!