Html: Python selenium code trials: Output: How print ooooo.pdf and aaaaa.pdf? I want to print more links, what should I do? Answer element_to_be_clickable() returns a single WebElement hence href attribute of only the first matching element is printed. Solution To extract all the href attribute values you have to induce WebDriverWait for visibility_of_all_elements_located() and you can use either of the
Tag: selenium
Try except till element is visible within the HTML DOM using Selenium Python
I am using selenium in python and here’s a line that waits 20 seconds but sometimes still gives error as follows: How can I use try except and after except statement say goto the same line to try again?? Answer To try the same line of code untill the operation is successfull you can wrapup the line of code within
How to change saved PDF page name with Selenium + Chromedrive
I have a script that uses Selenium Python to download a PDF page made based on this question My goal at the moment is to change the name of this file so that it is located with the name I chose and then change the destination folder of the saved file. My doubts are: Where should I change so that
How to get the value of an element within a tag?
I want to get the values of data-account and data-id which are elements within play-js tag. elemname = driver.find_elements_by_xpath(‘xpath…/div/play-js’) I tried like below, but I couldn’t get the value. With javascript, I was able to import it with the code below. How can I get the value of an element within a tag rather than the tag itself? Answer You
How to filter Selenium results setting a query limit?
I managed to get the data I wanted with selenium, but now I only need the first 17 data that it gives me, I need to make a kind of filter with this data, because I’m going to use conditions on top of them to use in another code. My result is below As you can see he gave me
AttributeError: ‘WebElement’ object has no attribute ‘select_by_value’ selecting dropdown menu using Selenium
I am trying to find menu prices for certain fast food restaurants from this website by different state. There is a dropdown menu where different states are the options. After I select a state (for example, California), I want to web scrape the different prices of their Ice Cream. However, I keep getting the same error message preventing me from
Selenium is unable to get element.text while using python and web driver
I am learning Selenium with Python. Above is my code. I want to retrieve this circled element in Wikipedia, as we can see it is an anchor tag<a> that is within a <div> that has an id of “articlecount”. I’ve tried the By.CSS_SELECTOR which didn’t work, so I use XPATH instead as shown in the code. But it still doesn’t
Need to run the code again if it fails, is there anyway out?
i have written a selenium automation code however it is very unstable because of the Salesforce website , i need some expertise in my code. i wanted to know how i can re run the code if it fails. below is my code , i will not able able to share some part of my code. i was trying to
Python Selenium unclickable button
I am working with the following website: www.offerte.smartpaws.ch I am trying to use the French site: www.offerte.smartpaws.ch/fr I have a piece of code that works with the German part but for some reason I get an error when trying to do the same thing on the French side, even if the elements are identical. I have the following code to
Extract href by class Selenium Python
Im trying to get all hrefs that are found the a specific class next to them. Im not really familiar with HTML so I’m having some trouble. Basically the HTML code in inspect is: I’m using the find_elements command to find all lines that include the class “notranslate _0imsa ” like this: I then extract all hrefs from “links” with