I am trying to access a specific button on a webpage so that I can click it and webscrape what's on the other side. I'm trying to use Selenium to return a list of buttons under a specific div so that I can click the first one. However, I receive an error upon clicking the 0th index.
I receive the following error:
ElementNotInteractableException: Message: element not interactable
(Session info: chrome=87.0.4280.88)
Am I unable to click elements if they are in a list? Or could this be something else?
Webpage: https://profiles.ucr.edu/app/home
Picture of HTML and desired ID element. I want to click the red "Browse" button:
div and button HTML
Here is the code that I am using, but it returns an error. I commented out the ability to print out the list of buttons:
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
PATH = "C:Program Files (x86)chromedriver.exe" #path to webdriver executable
wd = webdriver.Chrome(PATH)
urlDepartments = 'https://profiles.ucr.edu/app/home'
wd.get(urlDepartments)
time.sleep(1)
idFirst = 'cdk-accordion-child-'
idNum = 0
idNumStr = str(0)
div = wd.find_element_by_id(idFirst + idNumStr)
button = div.find_elements_by_tag_name('button')
button[0].click()
#print(button)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…