1

Python code:

from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://www.policybazaar.com/")
btn = driver.find_element_by_xpath('//a[@class="circleTab v3health"]')
btn.click

I want to click the "Health" button under the above mentioned website, but it gives me an error:

bound method WebElement.click of 
selenium.webdriver.firefox.webelement.FirefoxWebElement(session="b30bbdb3 
4401-40ab-9827-6fd0d554de50", element="c744a45a-e7ee-419c-9a46- 
bf522ed4f2e2"

When I inspect element, I found this: Content

What should be correct approach to make the script click health button?

1 Answers1

3

Button click is a function, call it with brackets

btn.click()

You may also like to wait for the page to load see Wait until page is loaded with Selenium WebDriver for Python or

import time
....
time.sleep (10) # before you call the click function
Dan-Dev
  • 8,957
  • 3
  • 38
  • 55