def random_youtube():
iterations = randint(1,8)
count = 0
while(1):
item = words[randint(0,len(words))]
driver.get("https://www.youtube.com/results?search_query="+item)
element = driver.find_element_by_class_name('yt-uix-tile-link')
element.click()
actions = ActionChains(driver)
actions.send_keys('K')
actions.perform()
time.sleep(randint(15,50))
print "currently on site: " + driver.current_url
count = count +1
if count == iterations:
break;
评论列表
文章目录