selenium-webdriver

Selenium find_element broke for loop

Selenium find_element broke for loop Question: I find elements with find_elements and after getting child elements with find_element, but the iteration doesn’t work further after find_element and the loop stops (although there are several elements found with find_elements) import os from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import …

Total answers: 1

Python & Selenium Code Bugs – Automation is NOT gathering data as expected

Python & Selenium Code Bugs – Automation is NOT gathering data as expected Question: a. I have a simple code for automation that I’m trying to learn from. The code is a robot software that finds key information about important scientists and display it to the user. b. the program introduces itself and explain the …

Total answers: 1

Selenium finding and updating class with web app

Selenium finding and updating class with web app Question: Some time ago I set up a Python script utilizing selenium to crawl across a website. I have tried to adopt the code to get data from a new webpage but have run into trouble. The issue seems to be that the page is an app …

Total answers: 1

Python selenium does not return the correct element

Python selenium does not return the correct element Question: I am new in selenium. I want to run the automation test for calendar with python selenium, but the return does not same as my expect The website for testing: https://letcode.in/calendar I want to select the date in the right calendar. the right calendar So I …

Total answers: 3

Automating filling in input fields and clicking a button using selenium

Automating filling in input fields and clicking a button using selenium Question: I am trying to create a flight scraper between two locations using google flights. I have tried the following: from selenium import webdriver if __name__ == "__main__": driver=webdriver.Chrome() driver.get(‘https://www.google.com/travel/flights’) driver.maximize_window() where_from = driver.find_element(‘xpath’, ‘/html/body/c-wiz[2]/div/div[2]/c-wiz/div[1]/c-wiz/div[2]/div[1]/div[1]/div[1]/div/div[2]/div[1]/div[1]/div/div/div[1]/div/div/input’) where_from.send_keys(‘Sydney’) where_to = driver.find_element(‘xpath’, ‘/html/body/c-wiz[2]/div/div[2]/c-wiz/div[1]/c-wiz/div[2]/div[1]/div[1]/div[1]/div/div[2]/div[1]/div[4]/div/div/div[1]/div/div/input’) where_to.send_keys(‘Auckland’) driver.implicitly_wait(30) search = …

Total answers: 1

opening two instances of chrome webdriver(with and without proxies) with selenium python

opening two instances of chrome webdriver(with and without proxies) with selenium python Question: I am trying to create two instances of chrome webdriver with selenium python. the first one uses proxies and the second one is proxyless. The problem I am facing is that the URL opened in the second instance doesn’t load(because it uses …

Total answers: 1

Selenium Other ways to find_element for onclick

Selenium Other ways to find_element for onclick Question: I am looking at a table that has this <tr onclick="setValue(‘115751’)" role="row" class="odd"> like shown below. I am trying use Selenium to find_element and click on distinct rows based on the setValue. Since I normally use xpath I tried to use that but xpath does not work …

Total answers: 1

Same kind of item but with different kinds of Xpath

Same kind of item but with different kinds of Xpath Question: I’m trying to crawl all the comments from a website. But the problem is some comments have different xpath structures. For example: Item 1: //*[@id="__next"]/div[1]/main/div[3]/div[4]/div/div[2]/div[3]/div[2]/div[3]/text() Item 2: //*[@id="__next"]/div[1]/main/div[3]/div[4]/div/div[2]/div[4]/div[2]/div[3]/div/span[1]/text() Item 3: //*[@id="__next"]/div[1]/main/div[3]/div[4]/div/div[2]/div[5]/div[2]/div[3]/text() I’m really confused by this problem, I hope I can receive a suitable …

Total answers: 1