Answer the question
In order to leave comments, you need to log in
How to click on an element in Selenium?
I want to click on the blog avatar, I try to hook on the "avatar circle" class, but I'm flying into exption. Here is the code:
option = webdriver.ChromeOptions()
driver = webdriver.Chrome(chrome_options=option)
url = 'https://www.tumblr.com/search/tatto+'
driver.get(url)
albums = driver.find_element_by_class_name('avatar circle')
# albums.click()
a = albums.size
x = random.randint(-a['height'],a['height'] )
y = random.randint(-a['width'], a['width'])
# action = ActionChains(driver)
ActionChains(driver).move_to_element_with_offset(albums, x, y).click().perform()
albums = driver.find_element_by_class_name('avatar circle')
. Why? How to do it differently?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question