3 Removed the "thank you" footer
source | link

I am trying to automate clicking on a button of a webpage where the source code has the following structure:

<div id="ctl02_" class="sel">
   <div id="Lo" class="cont">       
      <div class="cl">         
         <span onclick="__doPostBack('ct$ctl00','M_CC_1')" 
           class="fakeLink" title="add &quot;D&quot;"> 
           <img src="Skin/D.png" alt="add &quot;D&quot;" class="io" 
           />&nbsp;D</span> <br />

I am currently trying to accomplish this with the use of python and Selenium. Below you can find how I am trying to do this:

driver = webdriver.Firefox()
driver.wait = WebDriverWait(driver, 5)
driver.get("http://www.thewebpageIwanttoclickforwardto.com")

try:
   elem = driver.wait.until(EC.presence_of_element_located((By.XPATH, "//div[@class='cl']")))

except TimeoutException:
    print("Element not found")

elem.click()

The program finishes fine (exit code 0), however, the webdriver has not moved to the webpage behind the click (which I would encounter if I would physically click on the buttombutton D on the webpage). I have tried many things giving me the feeling that I am missing something basic here.

Where am I going wrong here? Am I using Selenium in a wrong way here? Or is Selenium not the right tool for this?

Many thanks in advance.

Tomas

I am trying to automate clicking on a button of a webpage where the source code has the following structure:

<div id="ctl02_" class="sel">
   <div id="Lo" class="cont">       
      <div class="cl">         
         <span onclick="__doPostBack('ct$ctl00','M_CC_1')" 
           class="fakeLink" title="add &quot;D&quot;"> 
           <img src="Skin/D.png" alt="add &quot;D&quot;" class="io" 
           />&nbsp;D</span> <br />

I am currently trying to accomplish this with the use of python and Selenium. Below you can find how I am trying to do this:

driver = webdriver.Firefox()
driver.wait = WebDriverWait(driver, 5)
driver.get("http://www.thewebpageIwanttoclickforwardto.com")

try:
   elem = driver.wait.until(EC.presence_of_element_located((By.XPATH, "//div[@class='cl']")))

except TimeoutException:
    print("Element not found")

elem.click()

The program finishes fine (exit code 0), however, the webdriver has not moved to the webpage behind the click (which I would encounter if I would physically click on the buttom D on the webpage). I have tried many things giving me the feeling that I am missing something basic here.

Where am I going wrong here? Am I using Selenium in a wrong way here? Or is Selenium not the right tool for this?

Many thanks in advance.

Tomas

I am trying to automate clicking on a button of a webpage where the source code has the following structure:

<div id="ctl02_" class="sel">
   <div id="Lo" class="cont">       
      <div class="cl">         
         <span onclick="__doPostBack('ct$ctl00','M_CC_1')" 
           class="fakeLink" title="add &quot;D&quot;"> 
           <img src="Skin/D.png" alt="add &quot;D&quot;" class="io" 
           />&nbsp;D</span> <br />

I am currently trying to accomplish this with the use of python and Selenium. Below you can find how I am trying to do this:

driver = webdriver.Firefox()
driver.wait = WebDriverWait(driver, 5)
driver.get("http://www.thewebpageIwanttoclickforwardto.com")

try:
   elem = driver.wait.until(EC.presence_of_element_located((By.XPATH, "//div[@class='cl']")))

except TimeoutException:
    print("Element not found")

elem.click()

The program finishes fine (exit code 0), however, the webdriver has not moved to the webpage behind the click (which I would encounter if I would physically click on the button D on the webpage). I have tried many things giving me the feeling that I am missing something basic here.

Where am I going wrong here? Am I using Selenium in a wrong way here? Or is Selenium not the right tool for this?

2 improve title
| link

Click No redirection after clicking on an element between <span><div>

1
source | link

Click on an element between <span>

I am trying to automate clicking on a button of a webpage where the source code has the following structure:

<div id="ctl02_" class="sel">
   <div id="Lo" class="cont">       
      <div class="cl">         
         <span onclick="__doPostBack('ct$ctl00','M_CC_1')" 
           class="fakeLink" title="add &quot;D&quot;"> 
           <img src="Skin/D.png" alt="add &quot;D&quot;" class="io" 
           />&nbsp;D</span> <br />

I am currently trying to accomplish this with the use of python and Selenium. Below you can find how I am trying to do this:

driver = webdriver.Firefox()
driver.wait = WebDriverWait(driver, 5)
driver.get("http://www.thewebpageIwanttoclickforwardto.com")

try:
   elem = driver.wait.until(EC.presence_of_element_located((By.XPATH, "//div[@class='cl']")))

except TimeoutException:
    print("Element not found")

elem.click()

The program finishes fine (exit code 0), however, the webdriver has not moved to the webpage behind the click (which I would encounter if I would physically click on the buttom D on the webpage). I have tried many things giving me the feeling that I am missing something basic here.

Where am I going wrong here? Am I using Selenium in a wrong way here? Or is Selenium not the right tool for this?

Many thanks in advance.

Tomas