InstaPy icon indicating copy to clipboard operation
InstaPy copied to clipboard

"arguments[0].scrollTop = arguments[0].scrollHeight", element)

Open fgisslen opened this issue 8 years ago • 10 comments

Traceback (most recent call last): File "/home/fredrik/InstaPy/5b7ab2a0690ebc0014a9e539.py", line 21, in session.interact_user_followers(['tarabarova'], amount=120, randomize=True) File "/home/fredrik/InstaPy/instapy/instapy.py", line 1820, in interact_user_followers self.logfolder) File "/home/fredrik/InstaPy/instapy/unfollow_util.py", line 919, in get_given_user_followers channel, logger, logfolder) File "/home/fredrik/InstaPy/instapy/unfollow_util.py", line 681, in get_users_through_dialog scroll_bottom(browser, dialog, 2) File "/home/fredrik/InstaPy/instapy/util.py", line 428, in scroll_bottom "arguments[0].scrollTop = arguments[0].scrollHeight", element) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 635, in execute_script 'args': converted_args})['value'] File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/webdriver.py", line 320, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.6/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document (Session info: headless chrome=68.0.3440.106) (Driver info: chromedriver=2.41.578700 (2f1ed5f9343c13f73144538f15c00b370eda6706),platform=Linux 4.15.0-33-generic x86_64)

@uluQulu And one more ;)

fgisslen avatar Aug 26 '18 09:08 fgisslen

Hello, Got the same error this morning !

samihamine avatar Aug 26 '18 09:08 samihamine

same here !

jtrieuDev avatar Aug 26 '18 11:08 jtrieuDev

same here :D

I use RaspberryPi/Rasbian, Python 3, Chrome and this setup:

` class MySetup(object):

def __init__(self, instaname):
    self.instaname = instaname
    self.passwort = '***'
    self.comments = [...]
    

def interactSeq2(self):
    self.session = InstaPy(username=self.instaname, password=self.passwort,
                            headless_browser=True,
                            multi_logs=True, nogui=True)
    try:
        #Setup
        self.session.login()

        self.session.set_relationship_bounds(enabled=False)
        self.session.set_comments(comments=self.comments,media='Photo')
        self.session.set_do_comment(enabled=True, percentage = randint(50,80))  
        
        self.session.set_do_follow(enabled=True, percentage=randint(20,30), times=1)
        self.session.set_user_interact(amount=1, randomize=True, percentage=randint(60,80), media='Photo')

        self.session.set_blacklist(enabled=True, campaign="Blacklist")

        #Action
        self.session.interact_user_followers(['***'], amount=randint(20,30), randomize=True)
        time.sleep(randint(200,400))
        self.session.interact_user_followers(['***'], amount=randint(20,30), randomize=True)
        time.sleep(randint(200,400))
        self.session.interact_user_followers(['***'], amount=randint(20,30), randomize=True)

    except Exception as exc:
            # if changes to IG layout, upload the file to help us locate the change
        if isinstance(exc, NoSuchElementException):
            file_path = os.path.join(gettempdir(), '{}.html'.format(time.strftime('%Y%m%d-%H%M%S')))
            with open(file_path, 'wb') as fp:
                fp.write(self.session.browser.page_source.encode('utf8'))
            print('{0}\nIf raising an issue, please also upload the file located at:\n{1}\n{0}'.format(
                '*' * 70, file_path))
             # full stacktrace when raising Github issue
        raise

    finally:
        self.session.end()

bot = MySetup('instaname') bot.interactSeq2 `

I run the bot on 3 RPis and the issure comes form diffrent SetUps but always form the unfollow_util.py file.

Here my full issure:

Traceback (most recent call last): File "Campange1_1.py", line 1753, in pi1() File "Campange1_1.py", line 1607, in pi1 schedule.run_pending() File "/home/pi/.local/lib/python3.5/site-packages/schedule/init.py", line 493, in run_pending default_scheduler.run_pending() File "/home/pi/.local/lib/python3.5/site-packages/schedule/init.py", line 78, in run_pending self._run_job(job) File "/home/pi/.local/lib/python3.5/site-packages/schedule/init.py", line 131, in _run_job ret = job.run() File "/home/pi/.local/lib/python3.5/site-packages/schedule/init.py", line 411, in run ret = self.job_func() File "Campange1_1.py", line 183, in interactSeq2 self.session.interact_user_followers(['motivation.union'], amount=randint(20,30), randomize=True) File "/home/pi/Desktop/InstaBot/instapy/instapy.py", line 1816, in interact_user_followers self.logfolder) File "/home/pi/Desktop/InstaBot/instapy/unfollow_util.py", line 910, in get_given_user_followers channel, logger, logfolder) File "/home/pi/Desktop/InstaBot/instapy/unfollow_util.py", line 729, in get_users_through_dialog person_list = dialog_username_extractor(buttons) File "/home/pi/Desktop/InstaBot/instapy/unfollow_util.py", line 751, in dialog_username_extractor if person and hasattr(person, 'text') and person.text: File "/usr/local/lib/python3.5/dist-packages/selenium-2.53.6-py3.5.egg/selenium/webdriver/remote/webelement.py", line 68, in text return self._execute(Command.GET_ELEMENT_TEXT)['value'] File "/usr/local/lib/python3.5/dist-packages/selenium-2.53.6-py3.5.egg/selenium/webdriver/remote/webelement.py", line 461, in _execute return self._parent.execute(command, params) File "/usr/local/lib/python3.5/dist-packages/selenium-2.53.6-py3.5.egg/selenium/webdriver/remote/webdriver.py", line 236, in execute self.error_handler.check_response(response) File "/usr/local/lib/python3.5/dist-packages/selenium-2.53.6-py3.5.egg/selenium/webdriver/remote/errorhandler.py", line 192, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document (Session info: headless chrome=67.0.3396.87) (Driver info: chromedriver=2.37 (undefined),platform=Linux 4.9.59-v7+ armv7l)

sebblessing avatar Aug 26 '18 16:08 sebblessing

any solution?

jozefpis avatar Aug 26 '18 18:08 jozefpis

Same problem for me. Maybe a instagram code update ?

MasterGregg avatar Aug 27 '18 14:08 MasterGregg

same here

TheAnswer2490 avatar Aug 27 '18 14:08 TheAnswer2490

any solution yet?

theRouter avatar Aug 27 '18 22:08 theRouter

this helped me https://github.com/timgrossmann/InstaPy/issues/2767#issuecomment-416295837

jozefpis avatar Aug 27 '18 22:08 jozefpis

The PR #2782 opened by @jiuguangw solved my problem ! You can test it

samihamine avatar Aug 27 '18 22:08 samihamine

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

stale[bot] avatar Nov 13 '18 20:11 stale[bot]