I have some Python/Selenium code that finds an element with the specified title text using XPath:
tab_element = WebDriverWait(driver, 10).until(lambda x: x.find_element_by_xpath('//a[@title="' + tab_title + '"]'))
It works fine in most cases, but it fails when it encounters an element with a title that contains double quotes.
<p title="that'll be the "dayg"">That'll be the "day"</p>
So, that leaves me with two questions:
How can I make it work with title values that contain double quotes?
How can I make it work with any title value, such as ones that contain both double and single quotes?