ncs15 / InstagramBot

Selenium Instagram Bot
1 stars 1 forks source link

Inner circle issue #5

Open mcolus opened 4 years ago

mcolus commented 4 years ago

Issue on the inner circle event

 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: chrome=86.0.4240.111)
mcolus commented 4 years ago

Where the code breaks

line 366, in getUserFollowers
    actionChain.key_down(Keys.SPACE).perform()
ncs15 commented 4 years ago

I could note replicate the issue, but i think it was because ActionChains needed to be reinstantiated. In the first version it is possible that ActionChain was using a stale DOM. Now it should work.

mcolus commented 4 years ago

I just tried it with a sleep(2) and it works without problems. Would be great if you would try it.

while True:
            actionChain.key_down(Keys.SPACE).perform()
            sleep(2)
            if time.time() > endtime:
                actionChain.key_up(Keys.SPACE).perform()

                break

        actionChain.double_click(body).perform()
        endtime = time.time() + 10.0
        while True:
            actionChain.key_down(Keys.SPACE).perform()
            sleep(2)
            if time.time() > endtime:
                actionChain.key_up(Keys.SPACE).perform()

                break