【发布时间】:2019-05-10 20:21:58
【问题描述】:
我正在尝试为列表中的每个项目创建多个 chrome 线程,并同时为列表中的每个项目执行函数,但不知道从哪里开始任何帮助将不胜感激。
代码片段
import sys
def spotify(elem1, elem2, elem3):
print("proxy: {}, cc: {}, cvc: {}".format(elem1, elem2, elem3))
def get_cc():
cc = ['5136154545452522', '51365445452823', '51361265424522']
return cc
def get_cvc():
cvc = ['734', '690', '734']
return cvc
def get_proxies():
proxies = ['51.77.545.171:8080', '51.77.254.171:8080', '51.77.258.82:8080']
return proxies
proxArr = get_proxies()
ccArr = get_cc()
cvcArr = get_cvc()
yeslist = ['y','yes']
for elem in zip(proxArr, ccArr, cvcArr):
spotify(elem[0], elem[1], elem[2])
restart=input("Do you wish to start again: ").lower()
if restart not in yeslist:
sys.exit("Exiting")
【问题讨论】:
-
这个帖子回答了你的问题吗? stackoverflow.com/questions/49617485/…
-
不,我没有尝试过那里的解决方案,但我收到了这个错误
AttributeError: module 'threading' has no attribute 'RLock' -
edit 我已经命名了 python 文件线程并得到了这个错误我现在已经改变了它并且来自链接的代码不会产生任何错误但它只运行一个 chrome
标签: python python-3.x selenium selenium-chromedriver