I am using below python code using selenium. click is not working on anchor tag having href = "#"
import time
import unittest
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome("E:\chromedriver.exe")
driver.get('file:///E:/Selenium/validateTest.html')
driver.find_element_by_xpath("//a[@id='validateData']/i[text()=' Validate Data']").click()
Here is the web html code that I am using.
<h1>Anchor tag</h1>
<a href="#" class="button js-button" role="button">Show content</a>
<a href="#" id="validateData" class="btn btn-red" onclick="document.write(5 + 6)"><i class="fa fa-binoculars" aria-hidden="true"></i> Validate Data</a>