Instantly share code, notes, and snippets.

Embed
What would you like to do?
import random
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome()
driver.get("http://www.youtube.com")
elems = driver.find_elements_by_xpath("//a[@href]")
linkToFollow = random.choice(elems)
driver.get(linkToFollow)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment