selenium

Select Date from dropdown datepicker using Selenium and Python

Select Date from dropdown datepicker using Selenium and Python Question: I tried to select different date rather than default (current date). e.g the initial page pop up with shareholding date : 2023/02/01, but I want to select different date say, 2022/12/23 from the dropdown menu. My environment is : Selenium 4.3.0 and Python 3.9.7, Chrome …

Total answers: 3

Selenium – how to click on the button

Selenium – how to click on the button Question: I am looking for the way to click on the button which is located in HTML this way: <button class="MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButtonBase-root css-1rs4rtx" tabindex="0" type="button"> Zaloguj siÄ™<span class="MuiTouchRipple-root css-w0pj6f"></span></button> I tried a few ways to find this without any success. from selenium import …

Total answers: 2

Extract table data from interactive webpage with python

Extract table data from interactive webpage with python Question: I would like to get the table data from a certain website to play with the data statistically, however I’m failing on the interactive button which selects each sector from the linked race. How can I iterate through the button list and store each table in …

Total answers: 1

How to click on the list when it said the list has no attribute "click"

Message element is not interactable Question: from selenium import webdriver import time from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import random import select driver = webdriver.Chrome(‘ChromeDriver’) driver.get("https://devbusiness.tunai.io/login") time.sleep(2) driver.maximize_window() #log in credentials username = driver.find_element(By.NAME, "loginUsername"); username.send_keys("xxxxx"); password = driver.find_element(By.NAME, "loginPassword"); password.send_keys("xxxxx"); login = …

Total answers: 2

Do I use random randint or random choice to random click on the list?

Do I use random randint or random choice to random click on the list? Question: For the picture below, I wish to perform an automation testing which is random click on the items and save it. Is this consider as a list? Selenium Python Asked By: Carl Carl || Source Answers: Use the one that …

Total answers: 1

Getting list of all the URLs in a Closed Issue page in GitHub using Selenium

Getting list of all the URLs in a Closed Issue page in GitHub using Selenium Question: I am trying to store the links of all the closed issues from a GitHub (https://github.com/mlpack/mlpack/issues?q=is%3Aissue+is%3Aclosed) project using Selenium. I use the code below: repo_closed_url = [link.find_element(By.CLASS_NAME,’h4′).get_attribute(‘href’) for link in driver.find_elements(By.XPATH,’//div[@aria-label="Issues"]’)] However, the above code only returns the first …

Total answers: 3

how to scrape all the pages of transfermarkt using selenium

how to scrape all the pages of transfermarkt using selenium Question: from selenium import webdriver import time driver = webdriver.Firefox() f = open("superliga.csv", "w") driver.get("https://www.transfermarkt.com/") f.write("Emri,Pozicioni,Mosha,Cmimi\n") f = open("superliga.csv", "a") time.sleep(1) for page in range(1,4,1): driver.get("https://www.transfermarkt.com/kategoria-superiore/marktwerte/wettbewerb/ALB1") elementet=driver.find_elements("xpath","/html/body/div[2]/main/div[2]/div[1]/div/div[3]/div/table/tbody/tr") for element in elementet: Emri =element.find_element("xpath", "./td[2]/table/tbody/tr[1]/td[2]/a").get_attribute("innerHTML") Pozicioni =element.find_element("xpath", "./td[2]/table/tbody/tr[2]/td").get_attribute("innerHTML") Mosha =element.find_element("xpath", "./td[4]").get_attribute("innerHTML") Cmimi =element.find_element("xpath", "./td[6]/a").get_attribute("innerHTML") f.write("{},{},{},{}n".format(Emri, Pozicioni,Mosha,Cmimi)) …

Total answers: 1

Selenium unable to locate button

Selenium unable to locate button Question: I am trying to click a button on a website in Python using Selenium. The html looks like this: <a class="btn btn-default btn-lg primary-light-blue-btn" onclick="createReport()">Create report</a> I have tried using: l = driver.find_element(By.XPATH, "//button[@class=’btn btn-default btn-lg primary-light-blue-btn’]") But I get the error: NoSuchElementException: no such element: Unable to locate …

Total answers: 2