I'm trying to use RSelenium to select an option from a drop-down menu, and am using XPath to locate the element I'm interested in.
The website is: https://pubmed.ncbi.nlm.nih.gov/?term=%282019-03-01%5BDate+-+Publication%5D+%3A+2019-03-31%5BDate+-+Publication%5D%29+AND+%28Hearing+Loss%5BMeSH+Terms%5D%29&size=200 and I'm trying to save the results in PMID format. My code selects the Format box, but when I want it to click the PMID option, it doesn't do so. Any help would be greatly appreciated. Below is my code:
webElem <- remDr$findElement(using = "css selector", "#save-results-panel-trigger")
webElem$sendKeysToElement(list(key = "enter"))
webElem <- remDr$findElement(using = "xpath", "//*[(@id = 'save-action-format')]")
webElem$clickElement()
remDr$findElement(using = "xpath","//*[(@value='pmid')]")$clickElement()