相关疑难解决方法(0)

使用XPath获取某些属性值

从以下HTML代码段:

<link rel="index" href="/index.php" />
<link rel="contents" href="/getdata.php" />
<link rel="copyright" href="/blabla.php" />
<link rel="shortcut icon" href="/img/all/favicon.ico" />
Run Code Online (Sandbox Code Playgroud)

我试图获得href的价值link标签与相对值= "shortcut icon",我试图做到这一点使用XPath.

如何在Python中做到这一点?

python xpath

9
推荐指数
1
解决办法
2万
查看次数

标签 统计

python ×1

xpath ×1