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

python selenium click element

element.click()
Comment

click a button using selenium python

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

PREVIOUS NEXT
Code Example
Python :: export flask app 
Python :: start a django project 
Python :: how to create a dictionary in python 
Python :: df to sql mysql 
Python :: how to download a project from pythonanywhere 
Python :: link in embed discord.py 
Python :: django get fields data from object model 
Python :: python square a number 
Python :: how to read hdf5 file in python 
Python :: most popular python libraries 
Python :: python how to find circle circumference 
Python :: json and python login system 
Python :: how to convert binary to integer in python 
Python :: simple jwt 
Python :: find charechtar index in string python 
Python :: Fill data in dataframe in pandas for loop 
Python :: install python in dockerfile 
Python :: python check phone number 
Python :: python int to bytes 
Python :: dfs python 
Python :: mechanize python 
Python :: Setting Up Stylesheet Django 
Python :: python get array from json 
Python :: extract DATE from pandas 
Python :: how to add to the end of an array python 
Python :: install python3 in ubuntu 
Python :: how many columns can a pandas dataframe have 
Python :: check if variable is function python 
Python :: download image from url python requests 
Python :: crawl a folder python 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =