find

How do I click a button with selenium

How do I click a button with selenium Question: Hello Guys i’m tryng to click a button but is not working. my code is like this: from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By driver = webdriver.Chrome() driver.implicitly_wait(0.5) driver.maximize_window() driver.get("https://www.freewayinsurance.com/") driver.implicitly_wait(0.5) element = driver.find_element(By.ID, "zipcode") element.send_keys("60056") element2 = driver.find_element(By.XPATH,"//div[@class=’c-hero-home-radio__form-items’]//button[@Class=’c-button c-button–orange’ and …

Total answers: 2

How to find element by link text using selenium and python

How to find element by link text using selenium and python Question: I am new to python. I am following some examples found online to learn it. One of the examples is to use "selenium" The example use "find_element_by_link_text", But it seems to be missing. I have to use "find_element" option. I am using following …

Total answers: 1

How can i get car names by using driver.find_elements(By.XPATH,'') with Python Selenium

How can i get car names by using driver.find_elements(By.XPATH,'') with Python Selenium Question: From this link, I want to get all of the car names as a list but only thing i can get is this: ————> Car name is : [] Here is the html code: <div class="headline-block u-margin-bottom-9"><span class="sponsored-badge">Sponsored</span><span class="h3 u-text-break-word">Opel Omega</span></div> Here …

Total answers: 2

Find and convert scripture reference to wiki link

Find and convert scripture reference to wiki link Question: I use a Bible inside of Obsidian that works fine when linking to one verse at a time. However, I still need to be able to link to ranges of verses. I decided to try to write a Python script that finds scripture references, and when …

Total answers: 1

Python checking the parentheses are equal on both sides

Python checking the parentheses are equal on both sides Question: I wrote a code but dont know how to make it find the extra unbalanced parentheses this is my code def checkBalance(str1): count = 0 for i in str1: if i == "(" or i == "{" or i == "[": count += 1 elif …

Total answers: 2

Beautiful Soup not returning anything I expected

Beautiful Soup not returning anything I expected Question: Background: Following along with a Udemy tutorial which is parsing some information from Bing. It takes in a user input and uses that as a parameter to search Bing with, returning all the href links it can find on the first page Code: from bs4 import BeautifulSoup …

Total answers: 3

Python: check for data type in list

Python: check for data type in list Question: Is there a way to check if an instance of a specific data type is present in a list / dictionary, without explicitly checking every element / key? I suspect the answer is no. If it does exist, though, I imagine it would be similar to the …

Total answers: 3

pandas – find first occurrence

pandas – find first occurrence Question: Suppose I have a structured dataframe as follows: df = pd.DataFrame({“A”:[‘a’,’a’,’a’,’b’,’b’], “B”:[1]*5}) The A column has previously been sorted. I wish to find the first row index of where df[df.A!=’a’]. The end goal is to use this index to break the data frame into groups based on A. Now …

Total answers: 7

Finding the indices of matching elements in list in Python

Finding the indices of matching elements in list in Python Question: I have a long list of float numbers ranging from 1 to 5, called “average”, and I want to return the list of indices for elements that are smaller than a or larger than b def find(lst,a,b): result = [] for x in lst: …

Total answers: 3