|
@@ -77,7 +77,17 @@ class Ssgdfs(object):
|
|
|
def open(self):
|
|
|
#self.display = Display(visible=0, size=(800, 600))
|
|
|
#self.display.start()
|
|
|
- self.driver = webdriver.Remote(command_executor=Demeter.config['setting']['phantomjs'], desired_capabilities=DesiredCapabilities.PHANTOMJS)
|
|
|
+ dcap = dict(DesiredCapabilities.PHANTOMJS)
|
|
|
+ #dcap["phantomjs.page.settings.userAgent"] = (random.choice(USER_AGENTS))
|
|
|
+ # 不载入图片
|
|
|
+ dcap["phantomjs.page.settings.loadImages"] = False
|
|
|
+
|
|
|
+ # 设置代理
|
|
|
+ #service_args = ['--proxy=127.0.0.1:9999','--proxy-type=socks5']
|
|
|
+ #self.driver = webdriver.Remote(command_executor=Demeter.config['setting']['phantomjs'], desired_capabilities=DesiredCapabilities.PHANTOMJS)
|
|
|
+
|
|
|
+ self.driver = webdriver.Remote(command_executor=Demeter.config['setting']['phantomjs'], desired_capabilities=dcap)
|
|
|
+
|
|
|
#options = webdriver.FirefoxOptions()
|
|
|
#options.add_argument('user-agent="Mozilla/5.0 (iPod; U; CPU iPhone OS 2_1 like Mac OS X; ja-jp) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5F137 Safari/525.20"')
|
|
|
#self.driver = webdriver.Chrome(firefox_options=options)
|