The xpath in your question has an error, not sure if it is a typo but this will not fetch any results.
There is an extra parantheses.
Instead of :
driver.find_elements_by_xpath("//*[contains(text()),'panel')]")
It should be :
driver.find_elements_by_xpath("//*[contains(text(),'panel')]")
Tip: To test your locators(xpath/CSS) - instead of directly using it in code, try it out on a browser first.
Example for Chrome:
- Right click on the web page you are trying to automate
- Click Inspect and do a CTRL-F.
- Type in your xpath and press ENTER
You should be able to scroll through all the matched elements and also verify the total match count