title: Unable to locate the element using CSS_SELECTOR in selenium using python
body: <p>I've been trying to locate and click() a javascript rendered image.
  Using css_selector I'm able to locate the element, however, I have to hover over the 1st element of the table in order to capture the location of the image. </p>
  
  <pre><code>&lt;tbody&gt;
  &lt;tr __gwt_row="0" __gwt_subrow="0" class="GPBYFDECG"&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG GPBYFDEEG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6847" tabindex="0"&gt;ACD CALL DETAILS NEW&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6848"&gt;sup001&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6849"&gt;2019-01-22 01:05:57&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6850"&gt;&lt;img onload="this.__gwtLastUnhandledEvent=&amp;quot;load&amp;quot;;" src="http://172.00.00.00.00:8889/ameyoreports/AmeyoReportsApp/clear.cache.gif" style="width:16px;height:16px;background:url(http://172.00.00.00:8889/ameyoreports/AmeyoReportsApp/0210CFCB6CBE82D7E9FAC82D9F901495.cache.png) no-repeat -308px -25px;" border="0"&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6851"&gt;SUCCESS&lt;/div&gt;&lt;/td&gt;&lt;td class="GPBYFDEBG GPBYFDEDG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6852"&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG gwt-Clickable-Custom"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6853"&gt;&lt;img onload="this.__gwtLastUnhandledEvent=&amp;quot;load&amp;quot;;" src="http://172.00.00.00.00/ameyoreports/AmeyoReportsApp/clear.cache.gif" style="width:24px;height:24px;background:url(http://172.00.00.00:8889/ameyoreports/AmeyoReportsApp/0210CFCB6CBE82D7E9FAC82D9F901495.cache.png) no-repeat -406px 0px;" border="0"&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG gwt-Clickable-Custom"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6854"&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="GPBYFDEBG GPBYFDEDG"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6855"&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="GPBYFDEBG GPBYFDEDG GPBYFDEOG gwt-Clickable-Custom"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6856"&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr __gwt_row="1" __gwt_subrow="0" class="GPBYFDEBH"&gt;
  &lt;td class="GPBYFDEBG GPBYFDECH GPBYFDEEG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-601"&gt;ACD CALL DETAILS NEW&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDECH datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-602"&gt;Administrator&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDECH datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-603"&gt;2019-01-22 18:06:58&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDECH datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-604"&gt;&lt;img onload="this.__gwtLastUnhandledEvent=&amp;quot;load&amp;quot;;" src="http://172.00.00.00:8889/ameyoreports/AmeyoReportsApp/clear.cache.gif" style="width:16px;height:16px;background:url(http://172.00.00.00:8889/ameyoreports/AmeyoReportsApp/0210CFCB6CBE82D7E9FAC82D9F901495.cache.png) no-repeat -308px -25px;" border="0"&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDECH datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-605"&gt;SUCCESS&lt;/div&gt;&lt;/td&gt;&lt;td class="GPBYFDEBG GPBYFDECH datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-606"&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDECH gwt-Clickable-Custom"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-607"&gt;&lt;img onload="this.__gwtLastUnhandledEvent=&amp;quot;load&amp;quot;;" src="http://172.00.00.00:8889/ameyoreports/AmeyoReportsApp/clear.cache.gif" style="width:24px;height:24px;background:url(http://172.00.00.00:8889/ameyoreports/AmeyoReportsApp/0210CFCB6CBE82D7E9FAC82D9F901495.cache.png) no-repeat -406px 0px;" border="0"&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDECH gwt-Clickable-Custom"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-608"&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="GPBYFDEBG GPBYFDECH"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-609"&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="GPBYFDEBG GPBYFDECH GPBYFDEOG gwt-Clickable-Custom"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-610"&gt;&lt;/div&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr __gwt_row="2" __gwt_subrow="0" class="GPBYFDECG"&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG GPBYFDEEG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6847" tabindex="0"&gt;ACD CALL DETAILS NEW&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6848"&gt;sup001&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6849"&gt;2019-01-22 01:05:57&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6850"&gt;&lt;img onload="this.__gwtLastUnhandledEvent=&amp;quot;load&amp;quot;;" src="http://172.16.10.23:8889/ameyoreports/AmeyoReportsApp/clear.cache.gif" style="width:16px;height:16px;background:url(http://172.00.00.00:8889/ameyoreports/AmeyoReportsApp/0210CFCB6CBE82D7E9FAC82D9F901495.cache.png) no-repeat -308px -25px;" border="0"&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6851"&gt;SUCCESS&lt;/div&gt;&lt;/td&gt;&lt;td class="GPBYFDEBG GPBYFDEDG datagridCellStyle"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6852"&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG gwt-Clickable-Custom"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6853"&gt;&lt;img onload="this.__gwtLastUnhandledEvent=&amp;quot;load&amp;quot;;" src="http://172.16.10.23:8889/ameyoreports/AmeyoReportsApp/clear.cache.gif" style="width:24px;height:24px;background:url(http://172.00.00.00:8889/ameyoreports/AmeyoReportsApp/0210CFCB6CBE82D7E9FAC82D9F901495.cache.png) no-repeat -406px 0px;" border="0"&gt;&lt;/div&gt;&lt;/td&gt;
      &lt;td class="GPBYFDEBG GPBYFDEDG gwt-Clickable-Custom"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6854"&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="GPBYFDEBG GPBYFDEDG"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6855"&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="GPBYFDEBG GPBYFDEDG GPBYFDEOG gwt-Clickable-Custom"&gt;&lt;div style="outline-style:none;" __gwt_cell="cell-gwt-uid-6856"&gt;&lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/tbody&gt;
  </code></pre>
  
  <p>Now, I need to click on the 7th child of the first row, which changes dynamically. First, It will be a different image and after processing, it will be a PNG button which can be clicked and the reports can be downloaded.</p>
  
  <p>By using the code below I was able to find the required element. However, I had to manually hover over the first row in order to do so. Additionally, If I hover over 2nd or 3rd row accidentally, content of 2nd and 3rd row will be downloaded instead of first.</p>
  
  <pre><code>WebDriverWait(driver, 60).until(EC.element_to_be_clickable((By.CSS_SELECTOR, ".GPBYFDEKG:nth-child(7) img"))).click() 
  </code></pre>
  
  <p>Is there any way I can click on the 7th child of first row whithout manually hover over it?</p>