Html 木偶演员查找svg使用xlink:href

Html 木偶演员查找svg使用xlink:href,html,xml,svg,xpath,puppeteer,Html,Xml,Svg,Xpath,Puppeteer,我有以下html: <button data-testid="likeButton"> <svg aria-hidden="true"> <use xlink:href="/logo"></use> </svg> <span>Like</span> </button> 但是当我测试它时,我得到了错误:

我有以下html:

<button data-testid="likeButton">
    <svg aria-hidden="true">
        <use xlink:href="/logo"></use>
    </svg>
    <span>Like</span>
</button>
但是当我测试它时,我得到了错误:

Unable to perform XPath operation. The prefix "xlink" for attribute "xlink:href" associated with an element type "use" is not bound.
改变

但是关于名称空间,请参见

Unable to perform XPath operation. The prefix "xlink" for attribute "xlink:href" associated with an element type "use" is not bound.
//*[name()='use'][contains(@*='logo')]
                             ^
//*[name()='use'][contains(@*,'logo')]
                             ^
//use[starts-with(@*,'/logo')]