我正在尝试自学一些Python,并且一直在开发一个使用selenium打开firefox并与netflix交互的项目,但我需要启用“播放DRM”才能进行流式传输,我在“set_preferences”中没有看到它' 并且我无法在首选项中检查内容页面上的元素,因此我不确定如何启用它。
import time, pyautogui, os
from selenium import webdriver as wd
from selenium.webdriver.common.keys import Keys
profile = wd.FirefoxProfile()
ntfx='http://www.netflix.com/'
driver=wd.Firefox()
driver.get(ntfx)
url = driver.current_url
最佳答案
花了4天时间,终于找到了解决方案
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.addPreference("media.eme.enabled",true);
firefoxOptions.addPreference("media.gmp-manager.updateEnabled", true);
然后将 firefoxOptions 添加到驱动程序
关于python - 在Python中使用selenium启用了 'Play DRM',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44369565/