Ok, so, I'm just getting started with InstaPy, but I'm supposing that when you start a session, we check either the geckodriver we have is the latest version or not, and if it is not the case then the expected behavior is to download the new one and start it...
Turns out that currently, with geckodriver 0.27, you get this error on linux 64 bit when trying to start an InstaPy session.
'Error, unable to determine correct filename for 64bit linux'
The reason is that the code in the webdriverdownloader dependency, wich gets the list of possible geckodriver versions to download and then filters for the ones that match your os and if it is 32 or 64 bit. Then it expects to have only one left in the list, wich it downloads. Turns out there are 2 now, with 2 extensions(something like '.tar.gz' and '.tar.gz.asc'). So the solution is to remove one of them so that we don't fall on the exception.
The one we want to remove is the one that ends on .asc cause apparently the program is expecting the other one
You can do that by changing a single line, i just made a pull request here where you can check it out: https://github.com/leonidessaguisagjr/webdriverdownloader/pull/12
After that all works fine...
Thanks man, tested and working.
I am having the same issue running on Digital Ocean and am unsure of how exactly to apply this fix
@gixxerfrank So what you should do is go to your virtual environment or wherever your pip is installing your project dependencies and then find the folder webdriverdownloader. The path may be something like this:
/home/ubuntu/apps/InstaPy/venv/lib/python3.6/site-packages/webdriverdownloader
Then, inside this folder you have to edit the file 'webdriverdownloader.py'
Arround the line 320 there's a line like this:
filename = [name for name in filenames if os_name + bitness in name ]
What you want to do is change it to something like this:
filename = [name for name in filenames if os_name + bitness in name and name[-3:] != 'asc' ]
or even this:
filename = [name for name in filenames if os_name + bitness in name and name[-7:] == '.tar.gz' ]
Works well, thanks a lot
Nice man thanks!
@gixxerfrank So what you should do is go to your virtual environment or wherever your pip is installing your project dependencies and then find the folder webdriverdownloader. The path may be something like this:
/home/ubuntu/apps/InstaPy/venv/lib/python3.6/site-packages/webdriverdownloader
Then, inside this folder you have to edit the file 'webdriverdownloader.py'
Arround the line 320 there's a line like this:
filename = [name for name in filenames if os_name + bitness in name ]What you want to do is change it to something like this:
filename = [name for name in filenames if os_name + bitness in name and name[-3:] != 'asc' ]
or even this:
filename = [name for name in filenames if os_name + bitness in name and name[-7:] == '.tar.gz' ]
Thanks so much, it works great!
I am having the same issue but when I deploy it in Heroku. How should I do?
@samuellmiller The problem is in the webdriverdownloader module. So, I'm not sure on how Heroku works but you must have a way to connect to the server or something. What you have to do then is find out where pip is installing stuff(for example running 'pip show webdriverdownloader' and looking at location) then you go and do the edits that I've mentioned...
change line 320 (+-) " filename = [name for name in filenames if os_name + bitness in name ] " by:
or:
execute "your_templare.py"
Thank You @LeydenJar <3
Thank you very much!
Verified on Ubuntu 16.04.6 LTS Server, thanks!
I am having the same issue but when I deploy it in Heroku. How should I do?
Did you find any solution for heroku? I solved the issue locally but unable to solve it on heroku. I'm able to make changes, but dynos does not make permanent changes. And hence it is just for time being.
i cannot find the webdriver folder.. i am very inexperienced with coding and attempted to follow the steps but i cannot find this folder anywhere.. I've located the InstaPy folder but inside of that are assets, db, and logs, none of which lead to webdriver
i cannot find the webdriver folder.. i am very inexperienced with coding and attempted to follow the steps but i cannot find this folder anywhere.. I've located the InstaPy folder but inside of that are assets, db, and logs, none of which lead to webdriver
i am using ubuntu btw
Hi @Courxge and @kmessilj,
It was fixed on version 0.9.0. Just update your version with
pip install webdrivermanager==0.9.0
When starting instapy manually on my raspberry everything works fine, but doing it via cronjob does not work.
I just tried both versions of the proposed script. Both then yield the new following error:
Traceback (most recent call last):
File "/home/pi/-/interact_plant.py", line 39, in
session = InstaPy(username=insta_username, password=insta_password, headless_browser=True)
File "/home/pi/.local/lib/python3.7/site-packages/instapy/instapy.py", line 333, in __init__
self.logger,
File "/home/pi/.local/lib/python3.7/site-packages/instapy/browser.py", line 130, in set_selenium_local_session
options=firefox_options,
File "/home/pi/.local/lib/python3.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 164, in __init__
self.service.start()
File "/home/pi/.local/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/home/pi/InstaPy/assets/geckodriver'
-----> Installing requirements with pip
! error fetching custom buildpack https://github.com/LeydenJar/webdriverdownloader/tree/fix_linux_64
! Push failed
Issue when deploy in heroku
Most helpful comment
@gixxerfrank So what you should do is go to your virtual environment or wherever your pip is installing your project dependencies and then find the folder webdriverdownloader. The path may be something like this:
/home/ubuntu/apps/InstaPy/venv/lib/python3.6/site-packages/webdriverdownloader
Then, inside this folder you have to edit the file 'webdriverdownloader.py'
Arround the line 320 there's a line like this:
filename = [name for name in filenames if os_name + bitness in name ]
What you want to do is change it to something like this:
filename = [name for name in filenames if os_name + bitness in name and name[-3:] != 'asc' ]
or even this:
filename = [name for name in filenames if os_name + bitness in name and name[-7:] == '.tar.gz' ]