Instapy: Check it if you're having issues with Firefox

Created on 13 Aug 2019  Â·  34Comments  Â·  Source: timgrossmann/InstaPy

I'm working on a new approach to solving the Firefox loading issues you guys are having.

Can you guys help to test this tool and give me some feedback?

1. copy the script content from: https://gist.github.com/converge/a0eeef0fe521d93a7b766d4c99fd805d
2. paste it into a file (ex. check_firefox.py)
3. run it: python3 check_firexo.py
wontfix

Most helpful comment

All 34 comments

ubuntu@ubuntu-server:~/scripts/InstaPy$ python3 instapy/check_firefox.py
Firefox is installed at: /usr/bin/firefox
Firefox version: Mozilla Firefox 68.0.1

ubuntu@ubuntu-server:~/scripts/InstaPy$
seems it works fine

jokes on me, I have the developer edition installed... and it checks for the normal firefox...
still doesnt work after firefox install..

@chewtoys instapy uses the non dev version, you can have both installed.

windows 10:

Firefox is installed at: C:\Program Files\Mozilla Firefox\firefox.exe
Firefox version: Mozilla Firefox 68.0.1

if your output is similar to the people above, your Firefox is working and you wouldn't experience any issue.

If, after that, you're still experience issues related to start of InstaPy, please share it here and I'll try to fix it.

*the approach above will be integrated to InstaPy later, thank you all!

Traceback (most recent call last):
  File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\quickstart.py", line 30, in <module>
    headless_browser=False)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\instapy\instapy.py", line 318, in __init__
    self.logger,
  File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\instapy\browser.py", line 114, in set_selenium_local_session
    options=firefox_options,
  File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 174, in __init__
    keep_alive=True)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\...\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

*This is the output of the script: *

Firefox is installed at: /usr/bin/firefox
Firefox version: Mozilla Firefox 60.8.0

This is the instapy output:

 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
Custom workspace set: "/root/botDev/InstaPy" :]

 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
Workspace in use: "/root/botDev/InstaPy"
Traceback (most recent call last):
  File "prueba.py", line 27, in <module>
    multi_logs=True)
  File "/root/botDev/InstaPy/instapy/instapy.py", line 318, in __init__
    self.logger,
  File "/root/botDev/InstaPy/instapy/browser.py", line 114, in set_selenium_local_session
    options=firefox_options,
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
    keep_alive=True)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: connection refused

I'm using geckodriver versión 0.17, I have tried the lastest version for raspebrry pi 3, wich is 0.23. this is the output of Instapy with geckodriver 0.23:

 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
Custom workspace set: "/root/botDev/InstaPy" :]

 ._.  ._.  ._.  ._.  ._.  ._.  ._.  ._. 
Workspace in use: "/root/botDev/InstaPy"
Traceback (most recent call last):
  File "prueba.py", line 27, in <module>
    multi_logs=True)
  File "/root/botDev/InstaPy/instapy/instapy.py", line 318, in __init__
    self.logger,
  File "/root/botDev/InstaPy/instapy/browser.py", line 114, in set_selenium_local_session
    options=firefox_options,
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__
    keep_alive=True)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: invalid argument: can't kill an exited process

Heres my out put

Firefox is installed at: C:\Program Files\Mozilla Firefox\firefox.exe Firefox version: Mozilla Firefox 68.0.1

I'm working on a new approach to solving the Firefox loading issues you guys are having.

Can you guys help to test this tool and give me some feedback?

1. copy the script content from: https://gist.github.com/converge/a0eeef0fe521d93a7b766d4c99fd805d
2. paste it into a file (ex. check_firefox.py)
3. run it: python3 check_firexo.py

Good idea, but the question is geckodriver version and path, that because a lot of users have an incompatible version or a wrong path, you can improve your script to check the righ version of geckodriver, same question for chromedriver and chrome.

Raspberry Pi 3B+
Geckodriver 0.23.0 for ARM from here: https://github.com/mozilla/geckodriver/releases

Firefox is installed at: /usr/bin/firefox
Firefox version: Mozilla Firefox 65.0

To get it worrking without freezing I had to enable SWAP at 500Mb
https://github.com/timgrossmann/InstaPy/issues/4823#issuecomment-520770024

@gerfra geckodriver is downloaded/installed automatically by another module, so I assume that there is no issue with geckodriver. About Chrome, we do use Firefox as default now.

what're your thoughts?

thanks for the feedback guys, I just proposed a solution here: https://github.com/timgrossmann/InstaPy/pull/4856

pls let me know if this solve your issue, if not, provide detailed information. another point is, check your available free memory, 500MB free memory is a good start.

@gerfra geckodriver is downloaded/installed automatically by another module, so I assume that there is no issue with geckodriver. About Chrome, we do use Firefox as default now.

what're your thoughts?

Well if you say "geckodriver is downloaded/installed automatically by another module, so I assume that there is no issue with geckodriver"
why use subprocess and many conditions in your script, just use this to get both values of firefox and geckodriver? And parse the output.

from selenium import webdriver
driver = webdriver.Firefox()
print (driver.capabilities)

@gerfra this is possible when webdriver is initialized with Firefox, most ppl issue is that Firefox isnt located, that's my approach, to initialize the browser in non default ways.

Firefox is installed at: /usr/bin/firefox
Firefox version: Mozilla Firefox 68.0.1

@converge Connection Checklist [2/3] (Instagram Server Status)
it's when trying this I get problems.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "xx.py", line 61, in
with smart_run(session):
File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
return next(self.gen)
File "/home/fredrik/InstaPy/instapy/util.py", line 1834, in smart_run
session.login()
File "/home/fredrik/InstaPy/instapy/instapy.py", line 408, in login
self.proxy_address,
File "/home/fredrik/InstaPy/instapy/login_util.py", line 284, in login_user
if not check_browser(browser, logfolder, logger, proxy_address):
File "/home/fredrik/InstaPy/instapy/login_util.py", line 262, in check_browser
logger=logger,
File "/home/fredrik/InstaPy/instapy/util.py", line 457, in update_activity
take_rotative_screenshot(browser, logfolder)
File "/home/fredrik/InstaPy/instapy/util.py", line 2377, in take_rotative_screenshot
browser.save_screenshot("{}screenshot_3.png".format(logfolder))
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 1055, in save_screenshot
return self.get_screenshot_as_file(filename)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 1032, in get_screenshot_as_file
png = self.get_screenshot_as_png()
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 1064, in get_screenshot_as_png
return base64.b64decode(self.get_screenshot_as_base64().encode('ascii'))
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 1074, in get_screenshot_as_base64
return self.execute(Command.SCREENSHOT)['value']
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.5/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSessionIdException: Message: Tried to run command without establishing a connection

thanks for the feedback guys, I just proposed a solution here: #4856

pls let me know if this solve your issue, if not, provide detailed information. another point is, check your available free memory, 500MB free memory is a good start.

Well with the new browser.py, now it works, It says: Suspicious Login Attempt and so I have to send back the code to login, then the following starts but I get action blocked, but with my smartphone app I can follow without any block...

thanks for the feedback guys, I just proposed a solution here: #4856

pls let me know if this solve your issue, if not, provide detailed information. another point is, check your available free memory, 500MB free memory is a good start.

It doesn't work for me. Still get the error I wrote.

@fgisslen your issue is not related to this issue, you're already running the browser.

For me it works but I have action blocked, only with the script.

I tried this but it still doesn't work for me. I got this problem: https://github.com/timgrossmann/InstaPy/issues/4869

I get the following output:

OSError: [Error 22] Invalid argument: ‘C:\Users\X\InstaPy\assets\extension.xpi’

I tried to uninstall and install again, and also I have used different scripts, but I keep getting this problem. Can someone help me? Thank you in advance

RASPBERRY PI2

script output:
Firefox is installed at: /usr/bin/firefox Firefox version: Mozilla Firefox 49.0

Instapy output:
File "Projects/instagram/instajoseph.py", line 13, in <module> disable_image_load=True) File "/home/joseph/.local/lib/python3.5/site-packages/instapy/instapy.py", line 321, in __init__ self.logger, File "/home/joseph/.local/lib/python3.5/site-packages/instapy/browser.py", line 114, in set_selenium_local_session options=firefox_options, File "/home/joseph/.local/lib/python3.5/site-packages/selenium/webdriver/firefox/webdriver.py", line 174, in __init__ keep_alive=True) File "/home/joseph/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 157, in __init__ self.start_session(capabilities, browser_profile) File "/home/joseph/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/home/joseph/.local/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/home/joseph/.local/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.SessionNotCreatedException: Message: Unable to find a matching set of capabilities

Hi,

Why in Raspberry Pi 3 with raspbian 4.19.58-v7+ the installed geckodriver version is geckodriver-v0.24.0-linux32 and not the arm?

Im trying to use the arm version but everytime i run the quickstart.py file, it re-downloads the linux32 version.

how can i set it manually?

thanks.

Raspberry Pi 3B+
Geckodriver 0.23.0 for ARM from here: https://github.com/mozilla/geckodriver/releases

Firefox is installed at: /usr/bin/firefox
Firefox version: Mozilla Firefox 65.0

To get it worrking without freezing I had to enable SWAP at 500Mb
#4823 (comment)

Hi! Would you please share how you managed to install Firefox 65 on Raspberry Pi 3B+? All it gives me is firefox-esr 60.8.0. And with 0.23 geckodriver I get: "can't kill an exited process". If I go lower on gecko (0.18, 01.17), it gives me: "connection refused." I've tried every gecko there is. Unfortunately, it is not working on Raspberry with firefox-esr 60.8.0 :( However, InstaPy is running just fine on my Odroid XU4 with Ubuntu and Firefox 68.0.2. But still I want to fix my Raspberry instance :)

Thanks in advance.

@RealSnaD did you get it working? I'm having the same issue https://github.com/timgrossmann/InstaPy/issues/4890#issuecomment-527268443 :/

Is there perhaps a tool for windows or am I not looking hard enough?

@ym85 did you get it working? I'm having the same issue #4890 (comment) :/

Nope, I haven't tried yet. I'll let you know if I decide to come back to this.

@ym85 are you instead using an alternative to InstaPy then?

@ym85 are you instead using an alternative to InstaPy then?

I’m still using InstaPy but on my OdroidXU4 with Ubuntu and latest FF. Not using Raspberry for now.

@ym85 wouldn't it be possible to run Ubuntu on a Pi? Which exact version does your Odriod run?

@ym85 wouldn't it be possible to run Ubuntu on a Pi? Which exact version does your Odriod run?

My Odroid's Ubuntu version is 18.04.2 LTS (GNU/Linux 4.14.107-157 armv7l). You can read this and try.

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