Instapy: Hide selenium extension "error"

Created on 3 Mar 2020  ·  11Comments  ·  Source: timgrossmann/InstaPy

Behavior when executing quickstart.py

WARNING [2020-03-03 00:50:32] [username123] - Hide Selenium Extension: error

Behavior when instapy fails after 20 minutes

selenium.common.exceptions.StaleElementReferenceException: Message: The element reference of <button class="_5f5mN jIbKX _6VtSN yZn4P "> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed

Most helpful comment

I've faced the same issue a couple hours ago and then, found an alternative way to hide selenium webdriver on Firefox. To do that, some preferences on Firefox should be added in browser.py file.
You can try to extend your code with the script between ADDED tags -it's under the set_selenium_local_session function- to hide selenium and, also to change the browser platform to iPhone. Another platform might be needed if you use different user agents.

This setting is working on me for now but not sure if it's a temporary solution or not. So, let me know about the results on you.

    # mute audio while watching stories
    firefox_profile.set_preference("media.volume_scale", "0.0")

    # ADDED
    firefox_profile.set_preference('dom.webdriver.enabled', False)
    firefox_profile.set_preference('useAutomationExtension', False)
    firefox_profile.set_preference('general.platform.override', 'iPhone')
    firefox_profile.update_preferences()
    # ADDED

    # prefer user path before downloaded one
    driver_path = geckodriver_path or get_geckodriver()
    browser = webdriver.Firefox(
        firefox_profile=firefox_profile,
        executable_path=driver_path,
        options=firefox_options)

All 11 comments

same here

same here

Helped on Kali Linux
Removed from all firefox directories. Installed from the repository firefox-esr. The error is gone
WARNING [2020-05-09 00:06:16] [**_*] - Hide Selenium Extension: error
INFO [2020-05-09 00:28:55] [**_*] - Hide Selenium Extension: ok

I installed 68.8 but still get the Hide Selenium Extension: error. Anyone has any clue on how to solve this?

I installed 68.8 but still get the Hide Selenium Extension: error. Anyone has any clue on how to solve this?

Completely uninstall Firefox from your system, restart and install Firefox ESR 68.8.
It fixed the issue on my end, Win10 Pro x64 b1909.

@TiagoDS7 Mhhmm. Is there a trick on how to uninstall Firefox completely? I mean I did a unistall but maybe it was not “clean” enough.

I've faced the same issue a couple hours ago and then, found an alternative way to hide selenium webdriver on Firefox. To do that, some preferences on Firefox should be added in browser.py file.
You can try to extend your code with the script between ADDED tags -it's under the set_selenium_local_session function- to hide selenium and, also to change the browser platform to iPhone. Another platform might be needed if you use different user agents.

This setting is working on me for now but not sure if it's a temporary solution or not. So, let me know about the results on you.

    # mute audio while watching stories
    firefox_profile.set_preference("media.volume_scale", "0.0")

    # ADDED
    firefox_profile.set_preference('dom.webdriver.enabled', False)
    firefox_profile.set_preference('useAutomationExtension', False)
    firefox_profile.set_preference('general.platform.override', 'iPhone')
    firefox_profile.update_preferences()
    # ADDED

    # prefer user path before downloaded one
    driver_path = geckodriver_path or get_geckodriver()
    browser = webdriver.Firefox(
        firefox_profile=firefox_profile,
        executable_path=driver_path,
        options=firefox_options)

Good evening!
Tested on Windows 7
Hide selenium extension: error
It helped me!
Windows 7 remove Firefox. Install Firefox 68.0b3.
Hide selenium extension: ok

I've faced the same issue a couple hours ago and then, found an alternative way to hide selenium webdriver on Firefox. To do that, some preferences on Firefox should be added in browser.py file.
You can try to extend your code with the script between ADDED tags -it's under the set_selenium_local_session function- to hide selenium and, also to change the browser platform to iPhone. Another platform might be needed if you use different user agents.

This setting is working on me for now but not sure if it's a temporary solution or not. So, let me know about the results on you.

    # mute audio while watching stories
    firefox_profile.set_preference("media.volume_scale", "0.0")

    # ADDED
    firefox_profile.set_preference('dom.webdriver.enabled', False)
    firefox_profile.set_preference('useAutomationExtension', False)
    firefox_profile.set_preference('general.platform.override', 'iPhone')
    firefox_profile.update_preferences()
    # ADDED

    # prefer user path before downloaded one
    driver_path = geckodriver_path or get_geckodriver()
    browser = webdriver.Firefox(
        firefox_profile=firefox_profile,
        executable_path=driver_path,
        options=firefox_options)

I can confirm that this fixed the problem for me on a Raspberry Pi 3

Good time of day to you gentlemans!

Tried just everything listed here on Windows 10, Windows 7, Ubuntu 16LTS Desktop, Ubuntu 16LTS Server, and latest Kali release.

Tried to downgrade InstaPy too, but with no any progress.

And guess what? Hide selenium: error.
Tried a lot of firefox releases on every system listed before.
Any suggestions?

Regards,
Max

I've faced the same issue a couple hours ago and then, found an alternative way to hide selenium webdriver on Firefox. To do that, some preferences on Firefox should be added in browser.py file.
You can try to extend your code with the script between ADDED tags -it's under the set_selenium_local_session function- to hide selenium and, also to change the browser platform to iPhone. Another platform might be needed if you use different user agents.

This setting is working on me for now but not sure if it's a temporary solution or not. So, let me know about the results on you.

    # mute audio while watching stories
    firefox_profile.set_preference("media.volume_scale", "0.0")

    # ADDED
    firefox_profile.set_preference('dom.webdriver.enabled', False)
    firefox_profile.set_preference('useAutomationExtension', False)
    firefox_profile.set_preference('general.platform.override', 'iPhone')
    firefox_profile.update_preferences()
    # ADDED

    # prefer user path before downloaded one
    driver_path = geckodriver_path or get_geckodriver()
    browser = webdriver.Firefox(
        firefox_profile=firefox_profile,
        executable_path=driver_path,
        options=firefox_options)

This solved the Issue on Mac using FF 78

Was this page helpful?
0 / 5 - 0 ratings

Related issues

v77v picture v77v  ·  3Comments

ghost picture ghost  ·  3Comments

CharlesCCC picture CharlesCCC  ·  3Comments

neomh picture neomh  ·  3Comments

seuraltimez picture seuraltimez  ·  3Comments