1
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
import threading
global counter
counter = 0
driver = webdriver.PhantomJS()
driver.set_window_size(1920, 1080)
class ssbooster(threading.Thread):
def login_logout(self):
while True:
driver.get('x')
select = Select(driver.find_element_by_id('x'))
select.select_by_visible_text('x')
driver.find_element_by_id('x').send_keys('x')
driver.find_element_by_id('x').send_keys('x')
driver.find_element_by_name('button').click()
global counter
counter += 1
print(counter)
x = ssbooster(ssbooster)
y = ssbooster(ssbooster)
x.start()
y.start()
此腳本使用PhantomJS,我不知道是否是問題所在。當我嘗試運行此代碼時,出現此錯誤。Python Threading AssertionError
Traceback (most recent call last):
File "C:/Users/x/Desktop/x/x.py", line 25, in <module>
x = ssbooster(ssbooster)
File "C:\Users\x\AppData\Local\Programs\Python\Python36-32\lib\threading.py", line 780, in __init__
assert group is None, "group argument must be None for now"
AssertionError: group argument must be None for now
我試過尋找這個,但所有的答案困惑我。我會appriciate它,如果有人可以告訴我是什麼原因造成的問題以及如何解決它。
謝謝!