Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

click button in selenium python

url = "https://yahoo.com"
driver = Firefox(executable_path="geckodriver.exe")
driver.get(url)
driver.find_element_by_css_selector("button.btn:nth-child(5)").click()
Comment

clicking a button in selenium python

# Finding and clicking elements using XPATH example

from selenium import webdriver
from selenium.webdriver.common.by import By

import time

driver = webdriver.Chrome("C:/chromeDriver/chromedriver")  # Make sure you have YOUR path to the chromedriver
driver.get("https://www.youtube.com/")
time.sleep(2)

# Clicking the menu button
driver.find_element(By.XPATH, "/html/body/ytd-app/div[1]/div/ytd-masthead/div[3]/div[1]/yt-icon-button[2]").click()
time.sleep(1)

# Clicking the 'Subscription' link
driver.find_element(By.XPATH, "/html/body/ytd-app/div[1]/tp-yt-app-drawer/div[2]/div/div[2]/div[2]/ytd-guide-renderer"
                              "/div[1]/ytd-guide-section-renderer[1]/div/ytd-guide-entry-renderer[4]/a").click()
Comment

click a button using selenium python

from selenium.webdriver import ActionChains
ActionChains(browser).click(element).perform()
Comment

PREVIOUS NEXT
Code Example
Python :: remove element from list 
Python :: python replace by dictionary 
Python :: remove substring from string python 
Python :: cv2.namedWindow 
Python :: convert 1 to "one" python 
Python :: loop throughthe key and the values of a dict in python 
Python :: doc2vec similarity 
Python :: create dictionary from string python 
Python :: count number of each item in list python 
Python :: how to convert into grayscale opencv 
Python :: python set remove multiple elements 
Python :: Image Watermarking in python 
Python :: matplotlib point labels 
Python :: run python notepad++ 
Python :: Pyspark Aggregation on multiple columns 
Python :: pandas to dictionary 
Python :: change tkinter app icon 
Python :: python slice a dict 
Python :: first and last digit codechef solution 
Python :: flask remove file after send_file 
Python :: python 3 f string float format 
Python :: python keep value recursive function 
Python :: view all columns in pandas dataframe 
Python :: takes 1 positional argument but 2 were given python 
Python :: list of python keywords 
Python :: drop first two rows pandas 
Python :: python how to count items in array 
Python :: python substring 
Python :: list variables in session tensorflow 1 
Python :: for loop with enumerate python 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =