InstaPy / InstaPy/instapy-quickstart

Failed to get followers, following and unfollowers counts

Đang mở
#154 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
777
Fork
763
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

On Windows 10 running through PyCharm.

I'm trying to get my followers and unfollowers from my original account (pre InstaPy) but InstaPy is unable to find them.

I run the following code:

```
from instapy import InstaPy
from instapy import smart_run

def job():
# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
password=insta_password,
want_check_browser=False,
headless_browser=True,
disable_image_load=True)
with smart_run(session):
session.set_quota_supervisor(enabled=True,
sleep_after=["likes", "comments_d", "follows",
"unfollows", "server_calls_h"],
sleepyhead=True, stochastic_flow=True,
notify_me=True,
peak_likes_hourly=55,
peak_likes_daily=566,
peak_comments_hourly=33,
peak_comments_daily=182,
peak_follows_hourly=55,
peak_follows_daily=None,
peak_unfollows_hourly=22,
peak_unfollows_daily=333,
peak_server_calls_hourly=None,
peak_server_calls_daily=4700)

nonfollowers = session.pick_nonfollowers(
username="kevinjohnsrude",
store_locally=True,
live_match=True)
print(nonfollowers)

job()
```

Here's my output:

```
InstaPy Version: 0.6.8
._. ._. ._. ._. ._. ._. ._. ._. ._.
Workspace in use: "C:/Users/Kevin/InstaPy"
INFO [2020-05-07 20:20:34] [kevinjohnsrude] Session started!
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
oooooooooooooooooooooooooooooooooooooooooooooooooooooo
....................................................................
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
INFO [2020-05-07 20:20:44] [kevinjohnsrude] Logged in successfully!
INFO [2020-05-07 20:20:44] [kevinjohnsrude] Saving account progress...
INFO [2020-05-07 20:21:37] [kevinjohnsrude] Failed to get followers count of 'b'kevinjohnsrude'' ~empty list
INFO [2020-05-07 20:22:27] [kevinjohnsrude] Failed to get following count of 'b'kevinjohnsrude'' ~empty list
WARNING [2020-05-07 20:22:27] [kevinjohnsrude] Unable to save account progress, skipping data update Message: TypeError: window._sharedData is undefined

INFO [2020-05-07 20:22:39] [kevinjohnsrude] Starting to pick Nonfollowers of kevinjohnsrude..
INFO [2020-05-07 20:22:39] [kevinjohnsrude] Retrieving live `Followers` data of kevinjohnsrude at "full" range
______________________________________________________________________________________________
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
INFO [2020-05-07 20:23:29] [kevinjohnsrude] Failed to get followers count of 'b'kevinjohnsrude'' ~empty list
INFO [2020-05-07 20:24:19] [kevinjohnsrude] Failed to get following count of 'b'kevinjohnsrude'' ~empty list
INFO [2020-05-07 20:24:19] [kevinjohnsrude] Sessional Live Report:
|> No any statistics to show

[Session lasted 3.85 minutes]
INFO [2020-05-07 20:24:19] [kevinjohnsrude] Session ended!
Traceback (most recent call last):
File "C:\Users\Kevin\.conda\envs\ig\lib\site-packages\instapy\relationship_tools.py", line 86, in get_followers

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

"return window.__additionalData[Object.keys(window.__additionalData)[0]].data."
File "C:\Users\Kevin\.conda\envs\ig\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 636, in execute_script
'args': converted_args})['value']
File "C:\Users\Kevin\.conda\envs\ig\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Kevin\.conda\envs\ig\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: TypeError: window.__additionalData[Object.keys(...)[0]] is undefined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/Kevin/Documents/PycharmProjects/ig/ig.py", line 88, in
job()
File "C:/Users/Kevin/Documents/PycharmProjects/ig/ig.py", line 85, in job
live_match=True)
File "C:\Users\Kevin\.conda\envs\ig\lib\site-packages\instapy\instapy.py", line 4417, in pick_nonfollowers
self.logfolder,
File "C:\Users\Kevin\.conda\envs\ig\lib\site-packages\instapy\relationship_tools.py", line 703, in get_nonfollowers
logfolder,
File "C:\Users\Kevin\.conda\envs\ig\lib\site-packages\instapy\relationship_tools.py", line 91, in get_followers
"return window._sharedData." "entry_data.ProfilePage[0]." "graphql.user.id"
File "C:\Users\Kevin\.conda\envs\ig\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 636, in execute_script
'args': converted_args})['value']
File "C:\Users\Kevin\.conda\envs\ig\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Kevin\.conda\envs\ig\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: TypeError: window._sharedData is undefined

Process finished with exit code 1
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu với relationship_tools.py trong get_followers và get_nonfollowers, sau đó lần theo lệnh gọi từ instapy.py thông qua pick_nonfollowers. Tái hiện script được cung cấp và kiểm tra các lỗi Selenium trong execute_script liên quan đến window.__additionalData và window._sharedData; hoàn thành khi lấy được số lượng follower và following mà không có các ngoại lệ JavaScript đã báo cáo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.