Unable to click on an element through Selenium Python
up vote
1
down vote
favorite
On google flights page, I want to click on the right arrow (increase number of days) at the bottom of the dialog (attached image). The second click gives me selenium.common.exceptions.TimeoutException
error.
Here is my code:
url = 'https://www.google.fr/flights'
driver.get(url)
elem1 = driver.find_elements_by_xpath("//span[@class='gws-flights-form__date-content']")[0]
elem1.click()
a = wait.until(EC.visibility_of_element_located((By.XPATH, "//<span[@class='gws-flights-dialog__calendar-duration-flipper-increase']")))
a.click()
Screenshot
selenium selenium-webdriver xpath css-selectors webdriverwait
add a comment |
up vote
1
down vote
favorite
On google flights page, I want to click on the right arrow (increase number of days) at the bottom of the dialog (attached image). The second click gives me selenium.common.exceptions.TimeoutException
error.
Here is my code:
url = 'https://www.google.fr/flights'
driver.get(url)
elem1 = driver.find_elements_by_xpath("//span[@class='gws-flights-form__date-content']")[0]
elem1.click()
a = wait.until(EC.visibility_of_element_located((By.XPATH, "//<span[@class='gws-flights-dialog__calendar-duration-flipper-increase']")))
a.click()
Screenshot
selenium selenium-webdriver xpath css-selectors webdriverwait
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
On google flights page, I want to click on the right arrow (increase number of days) at the bottom of the dialog (attached image). The second click gives me selenium.common.exceptions.TimeoutException
error.
Here is my code:
url = 'https://www.google.fr/flights'
driver.get(url)
elem1 = driver.find_elements_by_xpath("//span[@class='gws-flights-form__date-content']")[0]
elem1.click()
a = wait.until(EC.visibility_of_element_located((By.XPATH, "//<span[@class='gws-flights-dialog__calendar-duration-flipper-increase']")))
a.click()
Screenshot
selenium selenium-webdriver xpath css-selectors webdriverwait
On google flights page, I want to click on the right arrow (increase number of days) at the bottom of the dialog (attached image). The second click gives me selenium.common.exceptions.TimeoutException
error.
Here is my code:
url = 'https://www.google.fr/flights'
driver.get(url)
elem1 = driver.find_elements_by_xpath("//span[@class='gws-flights-form__date-content']")[0]
elem1.click()
a = wait.until(EC.visibility_of_element_located((By.XPATH, "//<span[@class='gws-flights-dialog__calendar-duration-flipper-increase']")))
a.click()
Screenshot
selenium selenium-webdriver xpath css-selectors webdriverwait
selenium selenium-webdriver xpath css-selectors webdriverwait
edited Nov 9 at 21:06
DebanjanB
35.4k73271
35.4k73271
asked Nov 9 at 20:08
PittLee
84
84
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
To click on the right arrow to increase number of days at the bottom of the dialog instead of using visibility_of_element_located()
method you need to use element_to_be_clickable()
method and you can use either of the following solutions:
CSS_SELECTOR
:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div.gws-flights-form__departure-input[data-flt-ve='departure_date'] div.gws-flights-form__next"))).click()
XPATH
:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]//div[@class='gws-flights-form__next']"))).click()
It still gives me selenium.common.exceptions.TimeoutException wait.until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]/div[@class='gws-flights-form__next']"))).click()
– PittLee
Nov 10 at 3:09
@PittLee How about the CSS-SELECTOR?
– DebanjanB
Nov 10 at 19:50
I got this error: selenium.common.exceptions.WebDriverException: Message: unknown error: Element <div aria-hidden="true" role="presentation" tabindex="-1" jstcache="5760" jsaction="jsl._" class="gws-flights-form__next" jsan="7.gws-flights-form__next,0.aria-hidden,0.role,0.tabindex,22.jsaction"></div> is not clickable at point (903, 156). Other element would receive the click: <div class="gws-flights__glass-pane" id="flt-glass" role="presentation" tabindex="-1" jsaction="jsl._" jstcache="5646" style="display: block;"></div>
– PittLee
Nov 11 at 0:22
1
The issue seems related to Chrome driver. I tried your solution in firefox, and it worked. Really appreciate your help!
– PittLee
Nov 11 at 14:53
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
To click on the right arrow to increase number of days at the bottom of the dialog instead of using visibility_of_element_located()
method you need to use element_to_be_clickable()
method and you can use either of the following solutions:
CSS_SELECTOR
:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div.gws-flights-form__departure-input[data-flt-ve='departure_date'] div.gws-flights-form__next"))).click()
XPATH
:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]//div[@class='gws-flights-form__next']"))).click()
It still gives me selenium.common.exceptions.TimeoutException wait.until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]/div[@class='gws-flights-form__next']"))).click()
– PittLee
Nov 10 at 3:09
@PittLee How about the CSS-SELECTOR?
– DebanjanB
Nov 10 at 19:50
I got this error: selenium.common.exceptions.WebDriverException: Message: unknown error: Element <div aria-hidden="true" role="presentation" tabindex="-1" jstcache="5760" jsaction="jsl._" class="gws-flights-form__next" jsan="7.gws-flights-form__next,0.aria-hidden,0.role,0.tabindex,22.jsaction"></div> is not clickable at point (903, 156). Other element would receive the click: <div class="gws-flights__glass-pane" id="flt-glass" role="presentation" tabindex="-1" jsaction="jsl._" jstcache="5646" style="display: block;"></div>
– PittLee
Nov 11 at 0:22
1
The issue seems related to Chrome driver. I tried your solution in firefox, and it worked. Really appreciate your help!
– PittLee
Nov 11 at 14:53
add a comment |
up vote
0
down vote
accepted
To click on the right arrow to increase number of days at the bottom of the dialog instead of using visibility_of_element_located()
method you need to use element_to_be_clickable()
method and you can use either of the following solutions:
CSS_SELECTOR
:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div.gws-flights-form__departure-input[data-flt-ve='departure_date'] div.gws-flights-form__next"))).click()
XPATH
:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]//div[@class='gws-flights-form__next']"))).click()
It still gives me selenium.common.exceptions.TimeoutException wait.until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]/div[@class='gws-flights-form__next']"))).click()
– PittLee
Nov 10 at 3:09
@PittLee How about the CSS-SELECTOR?
– DebanjanB
Nov 10 at 19:50
I got this error: selenium.common.exceptions.WebDriverException: Message: unknown error: Element <div aria-hidden="true" role="presentation" tabindex="-1" jstcache="5760" jsaction="jsl._" class="gws-flights-form__next" jsan="7.gws-flights-form__next,0.aria-hidden,0.role,0.tabindex,22.jsaction"></div> is not clickable at point (903, 156). Other element would receive the click: <div class="gws-flights__glass-pane" id="flt-glass" role="presentation" tabindex="-1" jsaction="jsl._" jstcache="5646" style="display: block;"></div>
– PittLee
Nov 11 at 0:22
1
The issue seems related to Chrome driver. I tried your solution in firefox, and it worked. Really appreciate your help!
– PittLee
Nov 11 at 14:53
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
To click on the right arrow to increase number of days at the bottom of the dialog instead of using visibility_of_element_located()
method you need to use element_to_be_clickable()
method and you can use either of the following solutions:
CSS_SELECTOR
:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div.gws-flights-form__departure-input[data-flt-ve='departure_date'] div.gws-flights-form__next"))).click()
XPATH
:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]//div[@class='gws-flights-form__next']"))).click()
To click on the right arrow to increase number of days at the bottom of the dialog instead of using visibility_of_element_located()
method you need to use element_to_be_clickable()
method and you can use either of the following solutions:
CSS_SELECTOR
:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "div.gws-flights-form__departure-input[data-flt-ve='departure_date'] div.gws-flights-form__next"))).click()
XPATH
:WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]//div[@class='gws-flights-form__next']"))).click()
answered Nov 9 at 21:07
DebanjanB
35.4k73271
35.4k73271
It still gives me selenium.common.exceptions.TimeoutException wait.until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]/div[@class='gws-flights-form__next']"))).click()
– PittLee
Nov 10 at 3:09
@PittLee How about the CSS-SELECTOR?
– DebanjanB
Nov 10 at 19:50
I got this error: selenium.common.exceptions.WebDriverException: Message: unknown error: Element <div aria-hidden="true" role="presentation" tabindex="-1" jstcache="5760" jsaction="jsl._" class="gws-flights-form__next" jsan="7.gws-flights-form__next,0.aria-hidden,0.role,0.tabindex,22.jsaction"></div> is not clickable at point (903, 156). Other element would receive the click: <div class="gws-flights__glass-pane" id="flt-glass" role="presentation" tabindex="-1" jsaction="jsl._" jstcache="5646" style="display: block;"></div>
– PittLee
Nov 11 at 0:22
1
The issue seems related to Chrome driver. I tried your solution in firefox, and it worked. Really appreciate your help!
– PittLee
Nov 11 at 14:53
add a comment |
It still gives me selenium.common.exceptions.TimeoutException wait.until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]/div[@class='gws-flights-form__next']"))).click()
– PittLee
Nov 10 at 3:09
@PittLee How about the CSS-SELECTOR?
– DebanjanB
Nov 10 at 19:50
I got this error: selenium.common.exceptions.WebDriverException: Message: unknown error: Element <div aria-hidden="true" role="presentation" tabindex="-1" jstcache="5760" jsaction="jsl._" class="gws-flights-form__next" jsan="7.gws-flights-form__next,0.aria-hidden,0.role,0.tabindex,22.jsaction"></div> is not clickable at point (903, 156). Other element would receive the click: <div class="gws-flights__glass-pane" id="flt-glass" role="presentation" tabindex="-1" jsaction="jsl._" jstcache="5646" style="display: block;"></div>
– PittLee
Nov 11 at 0:22
1
The issue seems related to Chrome driver. I tried your solution in firefox, and it worked. Really appreciate your help!
– PittLee
Nov 11 at 14:53
It still gives me selenium.common.exceptions.TimeoutException wait.until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]/div[@class='gws-flights-form__next']"))).click()
– PittLee
Nov 10 at 3:09
It still gives me selenium.common.exceptions.TimeoutException wait.until(EC.element_to_be_clickable((By.XPATH, "//div[@data-flt-ve='departure_date' and contains(@class,'gws-flights-form__departure-input')]/div[@class='gws-flights-form__next']"))).click()
– PittLee
Nov 10 at 3:09
@PittLee How about the CSS-SELECTOR?
– DebanjanB
Nov 10 at 19:50
@PittLee How about the CSS-SELECTOR?
– DebanjanB
Nov 10 at 19:50
I got this error: selenium.common.exceptions.WebDriverException: Message: unknown error: Element <div aria-hidden="true" role="presentation" tabindex="-1" jstcache="5760" jsaction="jsl._" class="gws-flights-form__next" jsan="7.gws-flights-form__next,0.aria-hidden,0.role,0.tabindex,22.jsaction"></div> is not clickable at point (903, 156). Other element would receive the click: <div class="gws-flights__glass-pane" id="flt-glass" role="presentation" tabindex="-1" jsaction="jsl._" jstcache="5646" style="display: block;"></div>
– PittLee
Nov 11 at 0:22
I got this error: selenium.common.exceptions.WebDriverException: Message: unknown error: Element <div aria-hidden="true" role="presentation" tabindex="-1" jstcache="5760" jsaction="jsl._" class="gws-flights-form__next" jsan="7.gws-flights-form__next,0.aria-hidden,0.role,0.tabindex,22.jsaction"></div> is not clickable at point (903, 156). Other element would receive the click: <div class="gws-flights__glass-pane" id="flt-glass" role="presentation" tabindex="-1" jsaction="jsl._" jstcache="5646" style="display: block;"></div>
– PittLee
Nov 11 at 0:22
1
1
The issue seems related to Chrome driver. I tried your solution in firefox, and it worked. Really appreciate your help!
– PittLee
Nov 11 at 14:53
The issue seems related to Chrome driver. I tried your solution in firefox, and it worked. Really appreciate your help!
– PittLee
Nov 11 at 14:53
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53232652%2funable-to-click-on-an-element-through-selenium-python%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown