url = 'https://etherscan.io/token/0x7ae1d57b58fa6411f32948314badd83583ee0e8c#readContract'
browser = webdriver.Chrome('C:\webdrivers\chromedriver')
headers1 = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36'
}
# wait = WebDriverWait(browser, 10)
browser.get(url)
time.sleep(10)
btn6 = browser.find_element_by_xpath('//*[@id="readHeading6"]/a') # error
btn6.click()
StackOverflow won't let me post an image so I copied the element below.
<a class="btn btn-link btn-block text-dark d-flex justify-content-between align-items-center py-2 collapsed" data-toggle="collapse" href="#readCollapse6" aria-expanded="false" aria-controls="readCollapse6">6. claimedByTokenId <span class="accordion-arrow"><i class="fas fa-arrow-down small"></i></span></a>
Also, every XPath helper I've used failed to recognise the button I'm trying to locate. I've tried finding by CSS selector, class name, id, XPath, full Xpath. The XPath in the code above is from chrome. Inspect element > copy > xpath.
I'm fairly new to programming so any help is appreciated! Thanks.