Perform comments as usual
None of the posts is commented on and I receive the following error:
Failed to get comments' count!
b"Message: javascript error: Cannot read property 'count' of undefined\n (Session info: chrome=72.0.3626.96)\n (Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.18.0-1011-azure x86_64)\n"
Working with python 3.6.7 on ubuntu
with smart_run(session):
""" Activity flow """
# general settings
session.set_relationship_bounds(enabled=True,
delimit_by_numbers=True,
max_followers=459000,
min_followers=45,
min_following=77)
session.set_action_delays(enabled=True,
like=3,
comment=5,
follow=4.17,
unfollow=28,
randomize=True,
random_range=(70, 140))
session.set_dont_like(
['dick', 'squirt', 'gay', 'homo',
'[nazi', 'promoter'
'jew', 'judaism', '[muslim', '[islam', 'bangladesh',
'[hijab', '[niqab', '[farright', '[rightwing',
'#conservative', 'death', 'racist'])
session.set_do_comment(enabled=True, percentage=80)
session.set_comments(['Awesome', 'Really Cool', 'Great', 'Nice shot! @{}'], media='Photo')
session.set_do_like(enabled=True, percentage=50)
session.interact_by_comments(usernames=users[id], posts_amount=80, comments_per_post=5, reply=True, interact=True, randomize=True, media="Photo")
having the same issue
I fixed the problem changing line 302 on comment_util.py from:
comments_count = browser.execute_script(
"return window._sharedData.entry_data."
"PostPage[0].graphql.shortcode_media."
"edge_media_to_comment.count")
comments_count = browser.execute_script(
"return window._sharedData.entry_data."
"PostPage[0].graphql.shortcode_media."
"edge_media_to_parent_comment.count")
@Nucklear thanks, it worked.
Thanks @Nucklear
I fixed the problem changing line 302 on comment_util.py from:
comments_count = browser.execute_script( "return window._sharedData.entry_data." "PostPage[0].graphql.shortcode_media." "edge_media_to_comment.count")
comments_count = browser.execute_script( "return window._sharedData.entry_data." "PostPage[0].graphql.shortcode_media." "edge_media_to_parent_comment.count")
Worked like a charm! @timgrossmann maybe this should be updated in the code?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this problem still occurs, please open a new issue
Most helpful comment
I fixed the problem changing line 302 on comment_util.py from:
comments_count = browser.execute_script( "return window._sharedData.entry_data." "PostPage[0].graphql.shortcode_media." "edge_media_to_comment.count")comments_count = browser.execute_script( "return window._sharedData.entry_data." "PostPage[0].graphql.shortcode_media." "edge_media_to_parent_comment.count")