InstaPy / InstaPy/instapy-quickstart

Failed to get followers, following and unfollowers counts

オープン
#154 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
777
フォーク
763
PR マージ指標
30日以内にマージされた PR はありません

説明

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
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start with relationship_tools.py in get_followers and get_nonfollowers, then trace the call from instapy.py through pick_nonfollowers. Reproduce the provided script and inspect the Selenium execute_script failures involving window.__additionalData and window._sharedData; done means follower and following counts are retrieved without the reported JavaScript exceptions.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。