Category: Selenium

How to get hover-information with selenium / beautifulsoup?

Query asked by user i would like to get the data form this hover-information on this site: https://www.pferdewetten.de/race/17350803 When i hover eg. over the first starter “Jumby Bay” i get this hover-information: When i inspect the code i can¬¥t see any informations of that? Is there any way to get this information scraped using selenium […]

Use the same variable value in other feature in cucumber

Query asked by user Following are my features and step definitions @Regression Scenario: Validate workflow with research ticket having risk rating 3 and Complexity as No known difficulty (assign to other) When “Analyst” logs in to application Then “MISToolKit” page should appear Then User navigates to “ResearchTicketDashboard” page When A research ticket with risk rating […]

By.XPATH problem in an automatic click with Selenium

Query asked by user I would like to automatically click on the blue logo of the likes (the one with the thumb inside), in order to open the list of those who have left the likes. I am referring to this little blue logo: In the question I want to focus only on this small […]

‘No module named ‘selenium.webdriver.common.by” Error in Selenium Python

Query asked by user I’m getting this output in Sublime Text when trying to run this code: from selenium import webdriver from selenium.webdriver.common.keys import Keys import time PATH = “C:/Users/josh.bailey/Documents/chromedriver.exe” driver = webdriver.Chrome(PATH) driver.get (“https://vehicleenquiry.service.gov.uk/”) time.sleep(5) search = driver.find_element_by_id(“wizard_vehicle_enquiry_capture_vrn_vrn”) search.send_keys(“*REDACTED*”) search.send_keys(Keys.RETURN) time.sleep(5) main = driver.find_element_by_class(“reg-mark-sm”) print(main.text) driver.quit() This is pretty basic code, I’m just trying […]

How to chose country of VPN(zenmate) chrome extension with selenium python

Query asked by user I want to automate choosing country of zenmate VPN extension with selenium but I don’t know how to access it this is my code to add the extension: from selenium import webdriver from selenium.webdriver.chrome.options import Options chrome_option = Options() chrome_option.add_extension(“vpn.crx”) driver1 = webdriver.Chrome(executable_path=’chromedriver.exe’,options=chrome_option) driver1.get(“https://www.google.com/”) Solution You can use pyautogui. Make your […]

Initialise WebDriver as dependency injection in Cucumber-JVM before test

Query asked by user I am new to Cucumber-JVM and previously I used to create a BaseTest class, initialise WebDriver there in some @BeforeMethod and then extend all other Test Classes from BaseTest class, so WebDriver initialisation is managed a single time in the code base and WebDriver initialisation happens before each test as it […]

How to use starts-with() in xpath to switch to frame using Selenium

Query asked by user Can anyone help me understand how i use the following java code in python and selenium: new WebDriverWait(driver,10).until(ExpectedConditions.frameToBeAvailableAndSwitchToIt(By.xpath(“//iframe[starts-with(@name, ‘a-‘) and starts-with(@src, ‘https://www.google.com/recaptcha’)]”)));¬† new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.cssSelector(“div.recaptcha-checkbox-checkmark”))).click(); I tried using string formatting and couldnt find a way of using starts-with() in python. Solution starts-with() is a xpath function used for finding the web […]

How to extract the price of the book from website using Selenium Python

Query asked by user I am trying to get the price of this book from this link (I am using google colab for the project) link of the webpage This is the code I have made: import sys sys.path.insert(0,’/usr/lib/chromium-browser/chromedriver’) from selenium import webdriver from selenium.webdriver.common.by import By options = webdriver.ChromeOptions() options.add_argument(‘–headless’) options.add_argument(‘–no-sandbox’) options.add_argument(‘–disable-dev-shm-usage’) wd = […]

Selenium error: element click intercepted:Other element would receive the click:

Query asked by user I’m trying to use Selenium to click on “show more” under “about this show” on this URL: https://www.bandsintown.com/e/1024477910-hot-8-brass-band-at-the-howlin’-wolf?came_from=253&utm_medium=web&utm_source=city_page&utm_campaign=event Here’s my code: #Get Event Info – expand ‘read more’ try: time.sleep(3) readMoreEvent = driver.find_element_by_xpath(“//div[@class=’xXGKBimvIBU_aEdJh3EF’]”).click(); print(“More Event Info Clicked”) except (ElementNotVisibleException, NoSuchElementException, TimeoutException): pass I’m getting an error: selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: […]