Selenium click trouble (Python)
<p>I am using Selenium (<code>ChromeDriver</code>) to automate a <a href="https://www.chess.com/play/computer" rel="nofollow">chess site</a> but I am having trouble clicking on a piece and moving it. I have tried <code>click()</code> and <code>ActionChains</code> but nothing is working. Here is my code:</p>

<pre><code>from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

T = r"C:\Users\HP\Downloads\chromedriver.exe"
options = webdriver.ChromeOptions()
options.add_argument("--start-maximized")
Driver = webdriver.Chrome(T, chrome_options=options)
Driver.get("https://www.chess.com/play/computer")
Driver.find_element_by_xpath('//*[@id="boardMessage"]/a').click()
Piece = WebDriverWait(Driver,10).until(EC.element_to_be_clickable((By.XPATH,'//*[@id="chessboard_boardarea"]/img[22]')))
Piece.click()
</code></pre>

<p>When I run the script nothing happens but the white pawn should be highlighted in yellow. Can someone explain why <code>.click()</code> or <code>ActionChains</code> is not working? How can I make it work?</p>

<p>P.S. If solution requires JavaScript help, please write it in more detail because I don't know JavaScript at all.</p>

<p>Selenium Webdriver is not the right tool for it.</p>

<p>You could try <a href="https://sourceforge.net/adobe/genie/wiki/Home/" rel="nofollow">Genie automation tool</a> if you are looking for a free tool. I've tried my hands on Genie, it's a bit complex but at the end it solves your problem.</p>

python selenium selenium-webdriver