详情页

xpath 获取meta里的keywords及description的方法

时间:2024年04月03日

编辑:佚名

html中的head的meta元素中的keywords与description标签如下:
<meta name="keywords" content="xxxx" >
<meta name="description" content="xxxx">
xpath获取属性使用@属性名就行了,如
//meta[@name='keywords']/@content[0]
//meta[@name='description']/@content[0]
相关文章
猜你需要