Instapy: Error trying to run quickstart.py

Created on 9 Mar 2018  路  11Comments  路  Source: timgrossmann/InstaPy

When I try to run the quickstart.py file it says "Cookie file not found... creating cookie" and gives me a traceback like this.

Traceback (most recent call last):
File "/home/ubuntu/InstaPy/quickstart.py", line 16, in
session.login()
File "/home/ubuntu/InstaPy/instapy/instapy.py", line 264, in login
self.bypass_suspicious_attempt):
File "/home/ubuntu/InstaPy/instapy/login_util.py", line 133, in login_user
"//select[@class='_fsoey']/option[text()='English']").click()
File "/usr/local/lib/python2.7/dist-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/webelement.py", line 72, in click
self._execute(Command.CLICK_ELEMENT)
File "/usr/local/lib/python2.7/dist-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/webelement.py", line 461, in _execute
return self._parent.execute(command, params)
File "/usr/local/lib/python2.7/dist-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: Message: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 3.13.0-135-generic x86_64)

Any help would be appreciated! :)

wontfix

Most helpful comment

That is your chromedriver being outdated. Please update to 2.36 and try again.

All 11 comments

would be great if you provide your code too. your quickstart.py code

I have the same problem.

Traceback (most recent call last):
  File "quickstart.py", line 37, in <module>
    session.login() 
  File "/home/windgub_gmail_com/InstaPy/instapy/instapy.py", line 264, in login
    self.bypass_suspicious_attempt):
  File "/home/windgub_gmail_com/InstaPy/instapy/login_util.py", line 133, in login_user
    "//select[@class='_fsoey']/option[text()='English']").click()
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webelement.py", line 72, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webelement.py", line 461, in _execute
    return self._parent.execute(command, params)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: call function result missing 'value'
  (Session info: headless chrome=65.0.3325.146)
  (Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 4.13.0-1011-gcp x86_64)

I installed InstaPy using this page https://github.com/timgrossmann/InstaPy/blob/master/docs/How_To_DO_Ubuntu_on_Digital_Ocean.md

My quickstart.py is:

from instapy import InstaPy
import random

insta_username = 'my_login'
insta_password = 'my_password'

tags = ['myart', 'dailyart', 'rusgalery', 'artoftheday', 'art', 'wacom',
        'topcreator', 'illustration', 'painting', 'drawing', 'draw', 'arts_help',
        'arts_gallery', 'artstagram', 'instaart', 'art_supernova', 'digitalart',
        'digitalartist', 'artwork', 'modernart']
comments = [u'Amazing! :heart_eyes: :heart_eyes:', u'Amazing!:sparkles::sparkles:',
            u'Amazing!:heartpulse::heartpulse:', u'Amazing!:dizzy::dizzy:',
            u'Amazing!:sparkling_heart::sparkling_heart:', u'Wow! :heart_eyes: :heart_eyes:',
            u'Wow!:sparkles::sparkles:', u'Wow!:heartpulse::heartpulse:',
            u'Wow!:dizzy::dizzy:', u'Wow!:sparkling_heart::sparkling_heart:',
            u'Nice! :heart_eyes: :heart_eyes:', u'Nice!:sparkles::sparkles:',
            u'Nice!:heartpulse::heartpulse:', u'Nice!:dizzy::dizzy:',
            u'Nice!:sparkling_heart::sparkling_heart', u'Awesome! :heart_eyes: :heart_eyes:',
            u'Awesome!:sparkles::sparkles:', u'Awesome!:heartpulse::heartpulse:',
            u'Awesome!:dizzy::dizzy:', u'Awesome!:sparkling_heart::sparkling_heart:',
            u'Wonderful! :heart_eyes: :heart_eyes:',
            u'Wonderful!:sparkles::sparkles:', u'Wonderful!:heartpulse::heartpulse:',
            u'Wonderful!:dizzy::dizzy:', u'Wonderful!:sparkling_heart::sparkling_heart:']
users = ['pokraslampas', 'loisvb', 'academic_art', 'thin_lisa', 'thin_lis', 'thin_liz',
         'invader', 'inaderwashere', 'tommyhilfiger','xenia_sobchak', 'takashiprom',
         'yanakrykova', 'artformuses', 'paul_berner', '_li_li_a_na_', 'elizavetik_m',
         'netvoya_elizart', 'dc_the_illustrator']

# set headless_browser=True if you want to run InstaPy on a server
try:
    session = InstaPy(username=insta_username,
                      password=insta_password,
                      headless_browser=True,
                      multi_logs=True,
                      nogui=True
                     )
    session.login()

    #settings
    #session.set_upper_follower_count(limit=50000)
    session.set_do_comment(True, percentage=25)
    random.shuffle(comments)
    session.set_comments(comments)
    session.set_do_follow(True, percentage=25, times=2)
    session.set_do_like(True, percentage=100)
    session.set_user_interact(amount=3, randomize=True, percentage=25, media='Photo')
    session.set_dont_unfollow_active_users(enabled=True, posts=5)

    # actions
    random.shuffle(tags)
    session.like_by_tags(tags, amount=50)

    random.shuffle(tags)
    session.follow_by_tags(tags, amount=30)

    session.unfollow_users(amount=240, onlyNotFollowMe=True, sleep_delay=60)

    session.follow_by_list(users, times=1)
finally:
    # end the bot session
    session.end()

Same

Does it work if you add the following on the session before login? e.g.

session.switch_language = False
session.login()

same

@Tjorriemorrie i have the same issue i already use that and works but now occurs other problem this is my code
`
session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=False,
multi_logs=True)

session.switch_language = False
session.login()

# settings
session.set_upper_follower_count(limit=2500)
session.set_do_comment(True, percentage=10)
session.set_comments(['aMEIzing!', 'So much fun!!', 'Nicey!'])
session.set_dont_include(['friend1', 'friend2', 'friend3'])
session.set_dont_like(['pizza', 'girl'])


# actions
session.like_by_tags(['natgeo'], amount=1)

finally:
# end the bot session
session.end()`

and now this is my trouble

`INFO [2018-03-12 16:47:54] [ninushome] Session started - 2018-03-12 16:47:54
INFO [2018-03-12 16:48:22] [ninushome] Logged in successfully!
INFO [2018-03-12 16:48:23] [ninushome] Tag [1/1]
INFO [2018-03-12 16:48:23] [ninushome] --> natgeo
INFO [2018-03-12 16:48:55] [ninushome] Session ended - 2018-03-12 16:48:55
INFO [2018-03-12 16:48:55] [ninushome] --------------------

Traceback (most recent call last):
File "/home/ubuntu/InstaPy/quickstart.py", line 29, in
session.like_by_tags(['natgeo'], amount=1)
File "/home/ubuntu/InstaPy/instapy/instapy.py", line 824, in like_by_tags
skip_top_posts)
File "/home/ubuntu/InstaPy/instapy/like_util.py", line 200, in get_links_for_tag
body_elem.send_keys(Keys.END)
File "/usr/local/lib/python2.7/dist-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/webelement.py", line 320, in send_keys
self._execute(Command.SEND_KEYS_TO_ELEMENT, {'value': keys_to_typing(value)})
File "/usr/local/lib/python2.7/dist-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/webelement.py", line 461, in _execute
return self._parent.execute(command, params)
File "/usr/local/lib/python2.7/dist-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: Message: unknown error: call function result missing 'value'
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 3.13.0-143-generic x86_64)`

That is your chromedriver being outdated. Please update to 2.36 and try again.

@Tjorriemorrie already work隆隆隆 thanks a lot

@Tjorriemorrie hi it was working fine and i install cron and schedule for use this now this happen

'Traceback (most recent call last):
File "/home/ubuntu/InstaPy/quickstart.py", line 5, in
session.login()
File "/home/ubuntu/InstaPy/instapy/instapy.py", line 271, in login
self.followed_by = log_follower_num(self.browser, self.username, self.logfolder)
File "/home/ubuntu/InstaPy/instapy/print_log_writer.py", line 11, in log_follower_num
"return window._sharedData.""entry_data.ProfilePage[0]."
File "/usr/local/lib/python2.7/dist-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 465, in execute_script
'args': converted_args})['value']
File "/usr/local/lib/python2.7/dist-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 236, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium-2.53.6-py2.7.egg/selenium/webdriver/remote/errorhandler.py", line 192, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: Message: unknown error: Cannot read property 'followed_by' of undefined
(Session info: chrome=65.0.3325.146)
(Driver info: chromedriver=2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752),platform=Linux 3.13.0-143-generic x86_64)'

that's been fixed. update master: git pull

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rahulkapoor90 picture rahulkapoor90  路  3Comments

Naramsim picture Naramsim  路  3Comments

neomh picture neomh  路  3Comments

harrypython picture harrypython  路  3Comments

wyvers picture wyvers  路  3Comments