css-selectors

Selenium can't find element by class name which needs to be clicked

Selenium can't find element by class name which needs to be clicked Question: On this page: https://finance.yahoo.com/quote/AAPL/balance-sheet?p=AAPL I want to click the "Collapse All button" Which are these classes: I have tried this in a few different ways but it looks like selenium can’t the button. What can be the problem with mij code? url …

Total answers: 1

Getting the HTML element using Selenium WebDriver

Getting the HTML element using Selenium WebDriver Question: I’m trying to get price of a product on amazon using Selenium: from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By url = "https://www.amazon.in/Celevida-Kesar-Elaichi-Flavor-Metal/dp/B081WJ6536/ref=sr_1_5?crid=3NRZERQ8H4T8L&keywords=dr+reddys+celevida&qid=1672124472&sprefix=%2Caps%2C5801&sr=8-5" services = Service(r"C:UsersDeepak Shetterchromedriver_win32chromedriver.exe") driver = webdriver.Chrome(service=services) driver.get(url) price = driver.find_element(By.CLASS_NAME, "a-offscreen") print("price is "+price.text) As you can see in …

Total answers: 2

Can't find element by name using selenium

Can't find element by name using selenium Question: I’m using selenium 4.7.2 and can’t find the element by its name. The following code returns NoSuchElementException error: from selenium import webdriver from selenium.webdriver.common.by import By import time # Get the website using the Chrome webbdriver browser = webdriver.Chrome() browser.get(‘https://www.woofshack.com/en/cloud-chaser-waterproof-softshell-dog-jacket-ruffwear-rw-5102.html’) # Print out the result price = …

Total answers: 1

How to click on next in the twitter sign in page using selenium – Python

How to click on next in the twitter sign in page using selenium – Python Question: I am trying to create a twitter automation bot using selenium but when I am trying to log in and click on the next button after entering the userID I am getting an error. I have tried using xpath, …

Total answers: 1

How to extract informations from a li tag with selenium

How to extract informations from a li tag with selenium Question: I have a website i want to scrape but the information am looking for is contained in an "li" tag. This "li" tag has no class or id. Also all the "li" tags are contained in an "ul" tag without class or id. There …

Total answers: 4

Click on last row of an HTML table with selenium

Click on last row of an HTML table with selenium Question: I am trying to click on the last row of a table using python and selenium. I have highlighted what I am trying to click in the HTML code image. lastRow = driver.find_element(By.CSS_SELECTOR("td.phone-leftinline yui-dt6-col-Type yui-dt-col-Type yui-dt-first:last-of-type")) lastRow.click() This codes keeps throwing an error: Traceback …

Total answers: 1

How To Get Selenium to Click Sign In Button

How To Get Selenium to Click Sign In Button Question: I’m trying to get selenium to log in to a page to scrape data. I can’t get it to click the "Sign in" button. Inspecting the button HTML gives me: <button class="btn__primary–large from__button–floating" data-litms-control-urn="login-submit" type="submit" aria-label="Sign in">Sign in</button> The online documentation for selenium has been …

Total answers: 3

Selenium Webdriver not able to locate and click button

Selenium Webdriver not able to locate and click button Question: I am trying to create a scraper, and for accessing the page I need to click on the Accept Cookies button. The HTML referring to the button is: <div class="qc-cmp2-summary-buttons"> <button mode="secondary" size="large" class=" css-1hy2vtq"> <span>MORE OPTIONS</span> </button><button mode="primary" size="large" class=" css-47sehv"> <span>AGREE</span></button></div> The button …

Total answers: 2

How to separately send email to the form

How to separately send email to the form Question: I made web contact form, my email sending to subscribe email box , I want to send email to the form only. Please help me driver.get(‘https://shop.rtrpilates.com/’) driver.find_element_by_partial_link_text(‘Contact’),click try: username_box = driver.find_element_by_xpath(‘//input[@type="email"]’) username_box.send_keys("[email protected]") I don’t understand how can I create a block between this, Help please Advance …

Total answers: 1

How to get the a href link from under the div class? using beautiful soup

How to get the a href link from under the div class? using beautiful soup Question: I am trying to scrape the href attribute from links from a page, but I end up with [] as the output The HTML code is My desired output is: https://www.pigiame.co.ke/listings/nissan-latio-2016-36000-kms-5300124 Asked By: Abduls || Source Answers: You can …

Total answers: 1