I’m trying to extract the text value following a b tag that contains specific text. I’m using Selenium web driver with Python3. The HTML inspected for the value I’m trying to return (11,847) is here: This has an Xpath below (I’m not using this xpath directly to find the element as the table construction changes for different examples that I
Tag: selenium
How to select random values from the list?
I am trying to perform a web automation testing, and now i am stucking at how to select random values from the outlet and time list. Kinda ran out of idea, hope someone could help, Thanks in Advance and Have a Nice day. Answer As far as I understand the code above, something like this should work:
Find elements by class name with Selenium in Python
I want to click on elements whose class is “innerImageWrapper editlink”. I use this code but it’s not working. it’s working. but I dont want use xpath. I want use class name Answer By.CLASS_NAME receives single value while here you trying to pass 2 values: innerImageWrapper and editlink. To locate element by 2 class names you can use CSS Selector
Selenium – How to find an element by part of the placeholder value?
Is there any way to find an element by a part of the placeholder value? And ideally, case insensitive. <input id=”id-9″ placeholder=”some TEXT”> Search by the following function doesn’t work browser.find_element(by=By.XPATH, value=”//input[@placeholder=’some te’]”) Answer You can always use contains instead of equals, as following: To make it case-insensitive you can use translate function, as following: Case-insensitive contains Xpath is taken
Python Selenium: Inputting Email Address and Password and click Continue
I am using the following code to input Email address and password, by clicking the continue element. However I have no idea should I enter driver.switch_to_frame and then webdriver can enter the email and password and click? Answer It’s unclear what is the problem you faced with, why your code didn’t work. Maybe you missind delay to wait for elments
How to solve “selenium.common.exceptions.NoSuchElementExceptio” in selenium when creating a twitter bot?
I am trying to creating a twitter bot and I am stuck on the log in page. Here is my code: I am always getting the the below mentioned error: I have tried it with css_selector, xpath, class, ID but nothing seems to work. I am not able to click the box to enter my email ID and password. Can
How to scrape table with flight data, avoiding an empty result?
I’m trying to extract a table from a webpage and have tried a number of alternatives, but the table always seems to remain empty. Two of what I thought were the most promising sets of code are attached below. Any means of extracting the data from the webpage would be considered as helpful. I have also included a screenshot of
Convert epoch to human-readable date python
I want to convert from epoch to date like that : 1575135888 ==> 3 years ago (https://i.stack.imgur.com/x2ZPW.png) I have this code : I got 2022-12-09 and 2019-11-30 18:44:48 I don’t know how to convert it to 3 years ago. Answer Well, you could use timedelta like this: Output: But I’m afraid that the meaning of “years ago” is ambiguous: Does
How do I convert this selenium next button clicking code into loop so I can get url of all the pages until next button disappears
Hello I wrote this selenium code to click Next button and give me url of the next page. The Question is I want to convert this code in a loop so I can click on the next button & collect all URLs until next button disappears. How do I out all the collected URLs in a list? I tried While
Get Text from SVG using Python Selenium
My first time trying to extract data from an SVG element, following is the SVG element and the code I have tried to put up by reading stuff on the internet, I have absolutely no clue how wrong I am and why so. I am trying to get the Categories and corresponding Percentages from the last 2 blocks of the