Linux ssl verification

This commit is contained in:
naibo 2023-07-10 03:40:25 +08:00
parent 3bb06403d4
commit 9a2311b820
6 changed files with 14 additions and 11 deletions

View File

@ -1370,16 +1370,19 @@ if __name__ == '__main__':
driver_path = os.path.join(
os.getcwd(), "EasySpider/resources/app/chrome_win32/chromedriver_win32.exe")
option.add_extension("EasySpider/resources/app/XPathHelper.crx")
options.add_extension("EasySpider/resources/app/XPathHelper.crx")
elif sys.platform == "win32" and platform.architecture()[0] == "64bit":
options.binary_location = os.path.join(
os.getcwd(), "EasySpider/resources/app/chrome_win64/chrome.exe")
driver_path = os.path.join(
os.getcwd(), "EasySpider/resources/app/chrome_win64/chromedriver_win64.exe")
option.add_extension("EasySpider/resources/app/XPathHelper.crx")
options.add_extension("EasySpider/resources/app/XPathHelper.crx")
elif sys.platform == "linux" and platform.architecture()[0] == "64bit":
options.binary_location = "EasySpider/resources/app/chrome_linux64/chrome"
driver_path = "EasySpider/resources/app/chrome_linux64/chromedriver_linux64"
option.add_extension("EasySpider/resources/app/XPathHelper.crx")
options.add_extension("EasySpider/resources/app/XPathHelper.crx")
else:
print("Unsupported platform")
sys.exit()
@ -1499,7 +1502,7 @@ if __name__ == '__main__':
options=options, chrome_options=option, executable_path=driver_path)
elif cloudflare == 1:
browser_t = MyUCChrome(
options=options, chrome_options=option, executable_path=driver_path)
options=options, chrome_options=option, driver_executable_path=driver_path)
print("Pass Cloudflare Mode")
print("过Cloudflare验证模式")
event = Event()
@ -1529,8 +1532,9 @@ if __name__ == '__main__':
with Listener(on_press=on_press_creator(press_time, event), on_release=on_release_creator(event, press_time)) as listener:
listener.join()
except:
print("您的操作系统不支持暂停功能。")
print("Your operating system does not support the pause function.")
pass
# print("您的操作系统不支持暂停功能。")
# print("Your operating system does not support the pause function.")
# print("线程长度:", len(threads) )

View File

@ -12,7 +12,7 @@ from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import Select
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
import undetected_chromedriver as uc
import undetected_chromedriver_ES as uc
desired_capabilities = DesiredCapabilities.CHROME
desired_capabilities["pageLoadStrategy"] = "none"

View File

@ -34,16 +34,16 @@ def on_press_creator(press_time, event):
press_time["is_pressed"] = True
else: # 按下p键时判断按下p键的时间是否超过2.5秒
duration = time.time() - press_time["duration"]
if duration > 2.5:
if duration > 2:
if event._flag == False:
print("任务执行中,按p键暂停执行。")
print("Task is running, press 'p' to pause.")
print("任务执行中,按p键暂停执行。")
print("Task is running, long press 'p' to pause.")
# 设置Event的值为True使得线程b可以继续执行
event.set()
else:
# 设置Event的值为False使得线程b暂停执行
print("任务已暂停,按p键继续执行...")
print("Task paused, press 'p' to continue...")
print("任务已暂停,按p键继续执行...")
print("Task paused, long press 'p' to continue...")
event.clear()
press_time["duration"] = time.time()
press_time["is_pressed"] = False

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long