# coding:utf-8
from selenium import webdriver
from time import ctime,sleep
import threading
class MyThread(threading.Thread): # 继承父类threading.Thread
def __init__(self, num):
threading.Thread.__init__(self)
self.num = num
# 把要执行的代码写到run函数里面 线程在创建后会直接运行run函数
def run(self):
for i in range(self.num):
driver = webdriver.Chrome()
driver.get("http://dev.dfpv/pluginfile.php/471/mod_resource/content/2/%E5%A4%87%E9%87%8F%E8%A1%A8%E5%AD%A6%E4%B9%A0%E8%A7%86%E9%A2%91_H264%E9%AB%98%E6%B8%85_480x360_H264%E9%AB%98%E6%B8%85_480x360.mp4")
print('I am %s.num:%s' % (self.getName(), i))
for i in range(1):
t = MyThread(10)
t.start()
t.join()