|
@@ -1,28 +1,14 @@
|
|
-# import redis
|
|
|
|
-import time
|
|
|
|
import traceback
|
|
import traceback
|
|
-# import json
|
|
|
|
-from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
|
|
|
|
-import time
|
|
|
|
-import os
|
|
|
|
-from selenium.webdriver.support.ui import WebDriverWait
|
|
|
|
-from selenium.webdriver.support import expected_conditions as EC
|
|
|
|
-import dataset
|
|
|
|
from selenium import webdriver
|
|
from selenium import webdriver
|
|
from selenium.webdriver.common.by import By
|
|
from selenium.webdriver.common.by import By
|
|
from selenium.webdriver.common.keys import Keys
|
|
from selenium.webdriver.common.keys import Keys
|
|
from selenium.webdriver.chrome.service import Service
|
|
from selenium.webdriver.chrome.service import Service
|
|
import json
|
|
import json
|
|
-import random
|
|
|
|
-import time
|
|
|
|
import redis
|
|
import redis
|
|
-import sys
|
|
|
|
-import codecs
|
|
|
|
import random
|
|
import random
|
|
import os
|
|
import os
|
|
import time
|
|
import time
|
|
-from userAgentRandomizer import userAgents
|
|
|
|
-import requests
|
|
|
|
|
|
+import redis
|
|
|
|
|
|
driver = None
|
|
driver = None
|
|
|
|
|
|
@@ -38,13 +24,13 @@ def re_get_webdriver():
|
|
print('quit....')
|
|
print('quit....')
|
|
driver = None
|
|
driver = None
|
|
try:
|
|
try:
|
|
- s = Service('/root/driver/chromedriver')
|
|
|
|
|
|
+ #s = Service('/root/driver/chromedriver')
|
|
options = webdriver.ChromeOptions()
|
|
options = webdriver.ChromeOptions()
|
|
options.add_argument("--no-sandbox")
|
|
options.add_argument("--no-sandbox")
|
|
options.add_argument("--disable-dev-shm-usage")
|
|
options.add_argument("--disable-dev-shm-usage")
|
|
options.add_argument("--headless")
|
|
options.add_argument("--headless")
|
|
- options.add_argument('--remote-debugging-port=9222')
|
|
|
|
- options.add_experimental_option("debuggerAddress", '127.0.0.1:9927')
|
|
|
|
|
|
+ #options.add_argument('--remote-debugging-port=9222')
|
|
|
|
+ #options.add_experimental_option("debuggerAddress", '127.0.0.1:9927')
|
|
options.add_argument("--incognito")
|
|
options.add_argument("--incognito")
|
|
r = redis.Redis(host='db.ptt.cx', port=6379, db=2, password='choozmo9')
|
|
r = redis.Redis(host='db.ptt.cx', port=6379, db=2, password='choozmo9')
|
|
data = r.get('google_proxy')
|
|
data = r.get('google_proxy')
|