webdriver

Selenium can't get this class

Selenium can't get this class Question: I’m trying to get the button clicked but Selenium cant reach that class : access-grants__flows-area__create-button container key_cli_btn = self._get_xpath("//div[@class=’/html/body/div/div/div[1]/div/div[3]/div/div[2]/div[2]/div[3]/div[4]/div’") print(key_cli_btn) This xpath is invalid : selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: `Unable to locate an element with the xpath expression //div[@class=’/html/body/div/div/div[1]/div/div[3]/div/div[2]/div[2]/div[3]/div[4]/div’ because of the following error: `SyntaxError: Failed to execute ‘evaluate’ …

Total answers: 1

Finding elements by class name inside a loop, selenium

Finding elements by class name inside a loop, selenium Question: I need to scrape in python a page that has some classes that are number like class1, class2, class3, … classN and I would like to locate the text contained in all those classes. I tried using find_element() function: list = [] for i in …

Total answers: 1

they give me empty output using selenium

they give me empty output using selenium Question: I am using wait method to find element but they give me empty output. What is the mistake? link https://www.amazon.co.uk//dp/B094FZ1XFJ from selenium import webdriver import time from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support.select import Select PATH="C:Program Files (x86)chromedriver.exe" url=’https://www.amazon.co.uk//dp/B094FZ1XFJ’ driver =webdriver.Chrome(PATH) driver.get(url) item = …

Total answers: 1

Cant get logging element

Cant get logging element Question: When i was testing my program, it’s end with code 1 here is full error ("Traceback (most recent call last): File "C:Usersds072PycharmProjectspythonProjectmain.py", line 20, in <module> wait.until(EC.element_to_be_clickable((By.XPATH, "/html/body/main/div/div/div/div[1]/div[3]/div[1]/div[1]/input"))).send_keys("my username")") here is my code (https://pastebin.com/RThnY8GY) I have tested alternatives for this value ("/html/body/main/div/div/div/div[1]/div[3]/div[1]/div[1]/input") but with out results :C Please help me …

Total answers: 1

Failed to get only the "text" from "span" by selenium

Failed to get only the "text" from "span" by selenium Question: this is my code: from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service service = Service("C:Developmentchromedriver.exe") driver = webdriver.Chrome(service=service) driver.get( "https://www.amazon.com/HB-UM43-%D7%A8%D7%9B%D7%96%D7%AA-Sabrent-USB-3-0/dp/B00JX1ZS5O/ref=d_ex_efse_dp_ps_d_sccl_2_13/134-8388945-8876241?pd_rd_w=PhytY&content-id=amzn1.sym.a33bdad7-13b2-4641-a8b3-d6f6ef5a7304&pf_rd_p=a33bdad7-13b2-4641-a8b3-d6f6ef5a7304&pf_rd_r=7R3T4DW86KG7CHFAJHJH&pd_rd_wg=fWhFq&pd_rd_r=5bc9d4df-38d2-4d93-aaee-c6e8e63dcbf4&pd_rd_i=B00JX1ZS5O&th=1") price = driver.find_element(By.CLASS_NAME, "a-offscreen") print(price.get_attribute(‘innerHTML’)) driver.quit() my results: <span dir="rtl">$</span>‎16.98‎ site element: <span class="a-offscreen"><span dir="rtl">$</span>‎16.98‎</span> I want to get only …

Total answers: 2

Message: Unable to locate element, Selenium Python

Message: Unable to locate element, Selenium Python Question: I’m trying to get access to this page "fullcollege" with a bot I’m making for students. The problem is that I can’t even select an element from it, and this error shows up. I have recently tested my code with another webpages like instagram and everything works …

Total answers: 1

trying to get href using selenium

trying to get href using selenium Question: I am trying to get href but they give me nothing these is page link https://www.nascc.aisc.org/trade-show import time from selenium import webdriver from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait driver = webdriver.Chrome("C:Program Files (x86)chromedriver.exe") URL = ‘https://www.nascc.aisc.org/trade-show’ …

Total answers: 2

Click item timing out selenium, python

Click item timing out selenium, python Question: Can anyone please explain to me why this is timing out I am trying to click a button on a webpage that opens a little pop-up window. This is the code I am using DotXpath=’//*[@id="clipboardenabled"]/div/pv-accounts-actions-manager/pv-accounts/pv-accounts-splitter/cyb-splitter/div/div[1]/pv-accounts-grid/cyb-server-data-table/div[1]/ag-grid-angular/div/div[2]/div[1]/div[3]/div[3]/div/div/div/div/cyb-actions-col/div/cyb-more-items-trigger-action-menu/cyb-floating-container/div/span/span/cyb-more-items-trigger/button/span’ Submit = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH,DotXpath))) Submit.click() Don’t know if it’ll help but here is …

Total answers: 1

how to replace certain part of python codes using def?

how to replace certain part of python codes using def? Question: I have many repeated codes with slightly different numbers. I’m trying to shorten my codes driver.execute_script("window.open(”);") driver.switch_to.window(driver.window_handles[1]) driver.get (url2) driver.execute_script("window.open(”);") driver.switch_to.window(driver.window_handles[2]) driver.get (url3) driver.execute_script("window.open(”);") driver.switch_to.window(driver.window_handles[3]) driver.get (url4) driver.execute_script("window.open(”);") driver.switch_to.window(driver.window_handles[4]) driver.get (url5) driver.execute_script("window.open(”);") driver.switch_to.window(driver.window_handles[5]) driver.get (url6) I’ve tried this def opentab(num): driver.execute_script("window.open(”);") driver.switch_to.window(driver.window_handles[{num-1}]) driver.get (url{num}) …

Total answers: 2