Jan-27-2019, 03:13 PM
Be aware that
For Path you have found.
find_elements_by_css_selector
and find_elements_by_xpath
return a list so use [0]
.button = browser.find_elements_by_css_selector('.btn') button[0].click()So CSS
.btn
and Xpath //button[@type='button']
are direct reference to button,of course if many buttons then need a more specific path.For Path you have found.
time.sleep(3) # Add some time to give site time to load button = browser.find_elements_by_xpath("/html/body/div[1]/div/div/div[2]/div[2]/div/div/div/div/div[2]/div[2]/div/div[2]") button[0].click()