|
|
@ -1,6 +1,7 @@ |
|
|
|
import json |
|
|
|
import json |
|
|
|
from selenium import webdriver |
|
|
|
from selenium import webdriver |
|
|
|
from selenium.webdriver import DesiredCapabilities |
|
|
|
from selenium.webdriver import DesiredCapabilities |
|
|
|
|
|
|
|
from selenium.webdriver.chrome.options import Options |
|
|
|
from cookiespool.config import * |
|
|
|
from cookiespool.config import * |
|
|
|
from cookiespool.db import RedisClient |
|
|
|
from cookiespool.db import RedisClient |
|
|
|
from login.weibo.cookies import WeiboCookies |
|
|
|
from login.weibo.cookies import WeiboCookies |
|
|
@ -33,7 +34,9 @@ class CookiesGenerator(object): |
|
|
|
self.browser = webdriver.PhantomJS(desired_capabilities=caps) |
|
|
|
self.browser = webdriver.PhantomJS(desired_capabilities=caps) |
|
|
|
self.browser.set_window_size(1400, 500) |
|
|
|
self.browser.set_window_size(1400, 500) |
|
|
|
elif BROWSER_TYPE == 'Chrome': |
|
|
|
elif BROWSER_TYPE == 'Chrome': |
|
|
|
self.browser = webdriver.Chrome() |
|
|
|
chrome_options = Options() |
|
|
|
|
|
|
|
chrome_options.add_argument('--headless') |
|
|
|
|
|
|
|
self.browser = webdriver.Chrome(chrome_options=chrome_options) |
|
|
|
|
|
|
|
|
|
|
|
def new_cookies(self, username, password): |
|
|
|
def new_cookies(self, username, password): |
|
|
|
""" |
|
|
|
""" |
|
|
|