I'm seeing a couple issues and pull requests related to a general issue with firefox drivers. Personally I managed to switch back to Chrome instead of Firefox, and that seemd to solve the issue for me. I'm also running a Windows 10.
I managed to run a local version of InstaPy with Chrome instead of Firefox with some 20 lines of code: not a big deal. Selenium already comes with this option.
If there is a way to use chrome instead of firefox also on RaspBPi3+ could be amazing!!
Can you post the code for the chrome bits my computer is having issues with firefox.
yes @ianmihura - please share the code :)
There's a couple lines you are going to edit, all in browser.py
First, add these two imports
from selenium.webdriver.chrome.options import Options as Chrome_Options
from instapy_chromedriver import binary_path
Then go to the function set_selenium_local_session and change this line
firefox_options = Firefox_Options()
for this one
chrome_options = Chrome_Options()
Then scan the whole function, the rest of the changes should become quite obvious.
Personally I found that two things I could live without:
firefox_profile=firefox_profile
and
browser.install_addon(create_firefox_extension(), temporary=True)
It might or might not be your case and you might have to find a way to make those work. I did not. I just commented those line out. And I live happier now.
Aside, if you get an error about the version of your chrome driver, get an older version of chrome webdriver here, scroll down. Selenium by default gets you the latest, but it might not work with your version of chrome. It did not work for me. So I just got the 72 webdriver and replaced it with the one in the Selenium libs. And I live happier now.
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
@ianmihura if it doesnt bother you Can you drop the code for browser.py? I tried your solution and changed some stuff in the function following your steps but it gives me error and not sure why it is happening. code would help a lot! thank you :)
I'm seeing a couple issues and pull requests related to a general issue with firefox drivers. Personally I managed to switch back to Chrome instead of Firefox, and that seemd to solve the issue for me. I'm also running a Windows 10.
Wouldn't it be better to give the user a chance to (or automatically) use both Chrome and Firefox, if one of them failed?
I managed to run a local version of InstaPy with Chrome instead of Firefox with some 20 lines of code: not a big deal. Selenium already comes with this option.
How can I use chrome instead of firefox? When I run the script it's always working on Firefox.
I'm seeing a couple issues and pull requests related to a general issue with firefox drivers. Personally I managed to switch back to Chrome instead of Firefox, and that seemd to solve the issue for me. I'm also running a Windows 10.
Wouldn't it be better to give the user a chance to (or automatically) use both Chrome and Firefox, if one of them failed?
I managed to run a local version of InstaPy with Chrome instead of Firefox with some 20 lines of code: not a big deal. Selenium already comes with this option.
How can I use chrome instead of firefox? When I run the script it's always working on Firefox.
@ianmihura and @metecicek Do you have a version of browser.py I can pull to replace the one in the release? Or do you have documentation on your solution you can share (besides the post above)? I want to try the same, but I am running on Ubuntu 20.04 and can use some help to get instapy running with Chrome instead of Firefox as Firefox is giving me issues.
@ianmihura if it doesnt bother you Can you drop the code for _browser.py_? I tried your solution and changed some stuff in the function following your steps but it gives me error and not sure why it is happening. code would help a lot! thank you :)
@imkimchi did you get the browser.py to work? If you did can you share the code? I am having the same issue you are having.
@powermeza sorry man, I no longer use InstaPy, and I had these changes only in my local version.
My suggestion is that you start from this description I made a while back, and see if it works for you. Note that I was working with Windows 10, and Linux might be different.
There's a couple lines you are going to edit, all in browser.py
First, add these two imports
from selenium.webdriver.chrome.options import Options as Chrome_Options
from instapy_chromedriver import binary_pathThen go to the function
set_selenium_local_sessionand change this line
firefox_options = Firefox_Options()
for this one
chrome_options = Chrome_Options()Then scan the whole function, the rest of the changes should become quite obvious.
Personally I found that two things I could live without:
firefox_profile=firefox_profile
and
browser.install_addon(create_firefox_extension(), temporary=True)It might or might not be your case and you might have to find a way to make those work. I did not. I just commented those line out. And I live happier now.
Aside, if you get an error about the version of your chrome driver, get an older version of chrome webdriver here, scroll down. Selenium by default gets you the latest, but it might not work with your version of chrome. It did not work for me. So I just got the 72 webdriver and replaced it with the one in the Selenium libs. And I live happier now.
Most helpful comment
If there is a way to use chrome instead of firefox also on RaspBPi3+ could be amazing!!