I'm trying to use Selenium to open a page and go to Netflix and open a video and play. Once I actually get to the video, I can't load it because I get the error:
Missing Components... Please visit chrome://components, locate the WidevineCdm component...
When going to chrome://components, there aren't any components installed. If I had opened Chrome regularly and navigated to the video like I did in Selenium, I can play it. When I got to chrome://components in regular Chrome, there are more components in there. I'm trying to find out how to import my normal Chrome settings but I can't seem to figure that out. I've tried using ChromeOptions and DesiredCapabilities.CHROME but I couldn't get it to work. I also can't find documentation on all the items inside the DesiredCapabilities.CHROME dictionary. I hope that once I'm able to get normal Chrome settings into the webdriver version, I'd be able to load Netflix videos via Selenium Chrome webdriver.
This is not exactly the full solution, but I figured if you use the Chrome's default user directory AND exclude the
disable-component-update
switch, the component will be loaded properly. You can find the path for Chrome's default user directory for different platforms here*.So for example on a Mac OS X, do this:
and you should see the WidevineCdm there!
I'll update this if I find a way to do it for custom user directories.
*Note that
Default
will be added to the end of the path automatically, so as you can see, I am NOT includingDefault
at the end of user-data-dir passed to selenium.UPDATE 1: Ok. I have a [hacky] solution if you want to use custom user dir. Excluding the
--disable-component-update
switch will load the components for you, but not completely. If you go tochrome://components
you will see the components are there, but they all haveversion=0.0.0.0
, and you need to click on the update button. Below is a simple loop that clicks on the update buttons:Note the
try-except
. You need it because there are some hidden buttons which throw an exception when you try to click them.