chrome = webdriver.Chrome()
chrome.get("https://www.hkexnews.hk/")
WebElement elements =
chrome.findElement(By.xpath,
"//[@id='rbAfter2006']/ul")
WebElement elements = chrome.findElement(By.xpath,"//[@id='rbAfter2006']/ul")
The problem is on above line, it shows error "Statements must be separated by newlines or semicolons. I have no idea what is the problem assigning elements on it.
UPDATED
Dynamic typing means that runtime objects (values) have a type, as opposed to static typing where variables have a type.
Dynamic type checking is the process of verifying the type safety of a program at runtime.
The error message you received does not really help to be honest but this meant that the IDE was not happy with:
WebElement elements = chrome.findElement(By.xpath,"//[@id='rbAfter2006']/ul")
but rather wants:
elements = chrome.findElement(By.xpath, "//[@id='rbAfter2006']/ul")