Updated description:
Here is the listing from Redfin.com https://www.redfin.com/CA/Sunnyvale/735-Grape-Ave-94087/home/1835008, what I want to locate and click is the "Favorite" button on the top-right corner. I've tried the code in the old description as well as all the suggestions by others, but none of them works.
Can someone guide me how to locate the icon in Selenium webdriver?
Thanks a lot!
+++++++++++++++++BELOW IS OLD PROBLEM DESCRIPTION+++++++++++++++++++++++++ I have this button:
<div role="button" title="Favorite" tabindex="0" class="clickable button tertiary-alt" data-rf-test-name="homeControlButton">
<span><svg class="SvgIcon rfSvg favorite svg-icon-off-color" style="height:24px;width:24px"><svg viewBox="0 0 24 24"></svg></svg></span>
</div>
But I tried with find XPath by:
browser.find_element_by_xpath("//*[@class='clickable button tertiary-alt' and @title='favorite']").click()
But it doesn't work. Any help?