Update nb4x.py
Browse files
nb4x.py
CHANGED
|
@@ -6,7 +6,6 @@ from selenium.webdriver.support.ui import WebDriverWait
|
|
| 6 |
from selenium.webdriver.support import expected_conditions as EC
|
| 7 |
from selenium.common.exceptions import TimeoutException
|
| 8 |
from selenium.webdriver.common.keys import Keys
|
| 9 |
-
from webdriver_manager.chrome import ChromeDriverManager
|
| 10 |
import time
|
| 11 |
import random
|
| 12 |
import string
|
|
@@ -332,11 +331,10 @@ def single_registration():
|
|
| 332 |
proxy = "http://yvighdwv-1:a5fyzm76khsv@p.webshare.io:80"
|
| 333 |
chrome_options.add_argument(f'--proxy-server={proxy}')
|
| 334 |
|
| 335 |
-
# 指定 Chrome 二进制文件路径
|
| 336 |
-
chrome_options.binary_location = "/usr/bin/google-chrome"
|
| 337 |
-
|
| 338 |
try:
|
| 339 |
-
|
|
|
|
|
|
|
| 340 |
wait = WebDriverWait(driver, 20)
|
| 341 |
success = registration_process(driver, wait)
|
| 342 |
|
|
|
|
| 6 |
from selenium.webdriver.support import expected_conditions as EC
|
| 7 |
from selenium.common.exceptions import TimeoutException
|
| 8 |
from selenium.webdriver.common.keys import Keys
|
|
|
|
| 9 |
import time
|
| 10 |
import random
|
| 11 |
import string
|
|
|
|
| 331 |
proxy = "http://yvighdwv-1:a5fyzm76khsv@p.webshare.io:80"
|
| 332 |
chrome_options.add_argument(f'--proxy-server={proxy}')
|
| 333 |
|
|
|
|
|
|
|
|
|
|
| 334 |
try:
|
| 335 |
+
# 直接使用系统安装的 ChromeDriver
|
| 336 |
+
service = Service('/usr/bin/chromedriver')
|
| 337 |
+
driver = webdriver.Chrome(service=service, options=chrome_options)
|
| 338 |
wait = WebDriverWait(driver, 20)
|
| 339 |
success = registration_process(driver, wait)
|
| 340 |
|