2017-11-17 14 views
0

Opera를 Python + Selenium으로 자동으로 조작하고 싶습니다.Python과 Selenium으로 Opera 제어하기

아래 URL을 참조하여 아래에 스크립트를 작성했습니다. 이 스크립트에 의해

from selenium import webdriver 
from selenium.webdriver.chrome import service 


webdriver_service = service.Service('/usr/bin/opera')   

webdriver_service.start() 

capabilities = { 'operaOptions': { 'debuggerAddress': "localhost:1212" }} 

browser = webdriver.Remote(webdriver_service.service_url, webdriver.DesiredCapabilities.OPERA) 

response = browser.get('https://www.facebook.com/') 

Drive Opera with selenium python

은 오페라가 시작하지만 페이스 북의 페이지가 열리지 않습니다.

어떻게 수정해야합니까? 도와주세요.

설정은 다음과 같습니다.

우분투 16.04, 파이썬 3.5.2, 셀레늄 3.6.0, 오페라 49.0

답변

0
capabilities = { 'operaOptions': { 'debuggerAddress': "localhost:1212" }} 

이 설정하고 있기 때문에, 나는 당신이 네트워크에 액세스하려면이 필요합니다 가정합니다. 하지만 웹 드라이브 성능에 맞춰 설정하지 않았습니다.

capabilities = webdriver.DesiredCapabilities.OPERA 
capabilities ['operaOptions'] = { 'debuggerAddress': "localhost:1212" } 
browser = webdriver.Remote(webdriver_service.service_url, capabilities)