Trying to get the number “6” from this html: Using this Selenium code: Getting the result from element: I.e. both the parent and the child elements text. Answer Try this xpath : .//div[@class=’sc-fAyiZu hNLuuN’].getAttribute(“innerText”).split(“”)[0]
Tag: selenium
With python’s selenium package, Why Chromedriver starts to display video instead of downloading when click on a tag?
Operating System: Windows 10, 64 bit Editor: VSCode 1.55 Python: 3.9.0 selenium: 3.141.0 I want Chromedriver to start downloading the video when I click on a tag. But instead, it opens a new tab and starts to display the video. The site that I’m trying to download from: https://www.aparat.com/v/9y8M5?playlist=683341 here is my code if needed: I will appreciate for any
Python Selenium – Clicking pages without next button
I would like to get info from multiple pages by clicking through them. The problem is there is not next button and even though the page link contains a number for counting through , as you can see in the image below. Can anyone help on how to solve this? Answer Just loop through the a tags and click them
After filling first card number field I can’t find any iframes on the page. How to solve this
class TestAplazame(unittest.TestCase): Look from here iframes are only available to the top block iframes elements are not available to the bottom block. included error message at the bottom if name == ‘main’: unittest.main() Even I can’t find the same iframe anymore. What is the problem. how to fix it. It’s a payment gateway test. gateway is from stripe I believe.
How can i click an button inside 2 divs in selenium python?
I’m trying to make selenium click Button1 but for some reasons, I get the following error: selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: Button1 I believe the error is happening because it is inside a div/ul/li tag but I can’t either figure out how to do it, I’m stuck. HTML: Python Code: Edit: I found out that the html is generated
How to get the filtered items alone from webpage using selenium python?
In this website https://rahulshettyacademy.com/seleniumPractise/#/. I filtered vegetables starting with CA and trying to get only displayed filtered items from the page. if I try the locators manually after the filter is giving only 4 instances same as if try with the script it is taking all the 30 items from the DOM. Answer The simplest way is to add some
Python/Selenium – “no such element: Unable to locate element”
I’m having a really hard time locating elements on this website. My ultimate aim here is scrape the score card data for each country. The way I’ve envisioned doing that is to have selenium click list view (as opposed to the default country view) and loop going in and out of all the country profiles, scraping the data for each
How to display something else when XPath hasn’t been found and overwriting previous Label
I am trying to create this app so that it finds the streamers views, if it doesn’t find the XPATH I want it to output “Streamer is offline” but it just outputs “Streamer is offline” even for online streamers. Also, when typing a new streamer the label does not overwrite, rather creates a new line. Answer In tkinter we use
Selenium webdriver : find element question
I am trying to use python Selenium for the first time. This would be a simple question for some of you but I am a bit disappointed here.. I would click on a link text which will open another webpage (WebDriver IE) When I inspect the link I have this: I tried this : but this will open another link
Click through dropdown menu with selenium
I am trying to create flashcards on quizlet.com with selenium. If you visit, you will see a “Create” button (or just a “+” depending on window size) in the navbar, when you click this it turns into a dropdown menu with 3 more buttons: ‘Study Set’, ‘Folder’ and ‘Class’. (I am trying to click Study Set) First, I am not