Python Forum
Selenium xpath finding gif to click
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selenium xpath finding gif to click
I am having trouble with clicking all buttons that are defined as animation format (.gif) in a website. I use 'xpath' in selenium to find these buttons with their ids but the script doesn't continue at this line. How can I click all these buttons by finding all gifs? My script is that:
from selenium import webdriver
from import Select
from import WebDriverWait

driver = webdriver.Firefox(executable_path=r'D:\geckodriver.exe')
Select(driver.find_element_by_id("ctl00_hld1_cbHavza")).select_by_visible_text("15. Kizilirmak Havzasi")
parent_handle = driver.current_window_handle
all_urls = []
all_images = driver.find_elements_by_xpath("//div[contains(@id,'OL_Icon')]/img")
for image in all_images :
     for handle in driver.window_handles :
          if handle != parent_handle:
              WebDriverWait(driver, 15).until(lambda d: d.execute_script('return document.readyState') == 'complete')
Hmm what a terribly design and look that site has Sick
Did a quick test.
Look like all those green dot interfere when selenium shall click on one.
Did not test anymore,can search for ElementClickInterceptedException to see if someone has a solution.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Selenium XPATH jimsxxl 2 1,465 Apr-06-2021, 03:19 PM
Last Post: jimsxxl
  Log In Button Won't Click - Python Selenium Webdriver samlee916 2 1,824 Jun-07-2020, 04:42 PM
Last Post: samlee916
  Hyperlink Click is not working in Selenium webdriver rajeev1729 0 874 May-02-2020, 11:21 AM
Last Post: rajeev1729
  selenium click in iframe fails 3Pinter 6 2,413 Apr-29-2020, 12:59 PM
Last Post: Larz60+
  need help with xpath pythonprogrammer 1 1,542 Jan-18-2020, 11:28 PM
Last Post: snippsat
  Python Selenium .click() Loads Error - Works Manually.- Events not Triggered NSearch 24 5,837 Aug-14-2019, 02:23 PM
Last Post: NSearch
  Selenium click on popup button??? GuJu 7 4,411 Jul-20-2019, 09:21 AM
Last Post: Nizam
  Click Element if displayed using Selenium and Python giaco__mar 1 2,318 Dec-27-2018, 06:19 PM
Last Post: metulburr
  Selenium chromedriver and click action Gilles95 4 10,680 Feb-07-2018, 07:28 PM
Last Post: Gilles95
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 2,315 Nov-03-2017, 08:41 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020