Vivaldi and Selenium
-
Saw a few old mentions (over a year), but nothing that answered my concern. I am trying to use Python + Selenium to automate Vivaldi. I have found some posts where people claim to have it working on Windows, but that is not an option for me. I'm working in an aws Linux 2 vm. Using Python 3.7 and selenium 3.141.0. Chromedriver 87 appears to be the correct one for the version of Vivaldi I downloaded today. From the posts I found, you have to add the binary location option, so my code looks like this:
chromedriverPath = "/usr/bin/chromedriver87" session = requests.session() headers = dict() headers['User-agent'] = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36' options = webdriver.ChromeOptions() options.add_argument('disable-infobars') options.add_argument('--start-maximized') options.add_argument('--no-sandbox') options.add_argument('test-type') options.binary_location = r'/opt/vivaldi/vivaldi' driver = webdriver.Chrome(executable_path=chromedriverPath, chrome_options=options) testURL = r'http://www.google.com' driver.get(testURL) time.sleep(5)
I have left the other arguments in that I usually use when driving Chrome, but have also tried commenting them out.
Vivaldi works fine on my system.
But when I try to run it from Selenium, it does launch Vivaldi (which makes me suspect I'm close), but it comes up with "data:," in the url window and eventually errors out with:selenium.common.exceptions.WebDriverException: Message: unknown error: unable to discover open pages
Has anyone gotten this to work properly?
-
Hello @bjquinniii , I had a similar problem and was able to solve it , check my blog post maybe it'll be useful for you .
https://mossab.hashnode.dev/linux-use-selenium-with-vivaldi-browser -
@mossab Thanks for your interesting article!
I have not tested Vivaldi with Selenium yet, but i know it did not work in the past.
But as i know you can not test the Vivaldi UI with Selenium.
-
Hello @doctorg , thanks for your interest in my article.
-
with Vivaldi 4.1.2369 ( chrome 92.0.4515.134) and chromedriver 92 the unable to discover open pages
error is no longer observed - neither on Linux nor on Windows -
@bjquinniii on Arch Linux everything is fine!
BUT you have to use AUR version!
version from pacman - not working at all, something wrong with chromedriver i suppose
-
@chombor said in Vivaldi and Selenium:
BUT you have to use AUR version!
And were is the repor for this Selenium version? Which packages are needed to get Selenium working with Vivaldi?
-
@doctorg in Arch Linux everything is bleeding edge, you silly
-
@chombor Rude.
-
@chombor <ironic> Oh, ok, Arch is Testing and Rolling Release every hour. Or a Compile-All-Yourself
-
@chombor said in Vivaldi and Selenium:
you silly
Oh, please, do not blame me, i am a innocent person, wont hurt you, Archibald. Hähähää
-
@chombor Thanks for the hint on Selenium, i will try next week to install and compile for a test.
-
@doctorg said in Vivaldi and Selenium:
@chombor <ironic> Oh, ok, Arch is Testing and Rolling Release every hour. Or a Compile-All-Yourself
don't be so ironic - by default testing repos in pacman are off
-
@doctorg said in Vivaldi and Selenium:
@chombor Thanks for the hint on Selenium, i will try next week to install and compile for a test.
i'm new in web scraping, but i can tell you already that S. is pure crap..:
-
image_bytes = io.BytesIO(driver.get_screenshot_as_png())
function naming is just awful and misleading -
driver.get(i['url'])
Type of "get" is partially unknown Type of "get" is "(url: Unknown) -> None"Pylance
typing useless and awful too -
no async/await support
-
and official documentation is just... you get the idea..
lxml even worse btw..
i suggest you to use playwright - pure gold ! from M$ lol
top doc. top typing hints. top human design. top async performance. -