【发布时间】:2017-05-22 16:11:24
【问题描述】:
我想用 xpath 获取一个带有“ac-algo fz-l ac-21th lh-24”类名的 html 页面中的所有链接。
我写的代码:
string links = node.SelectSingleNode(".//a[(@class,'ac-algo fz-l ac-21th lh-24')]").GetAttributeValue("href", null);
但我得到这个错误:
'.//a[(@class,'ac-algo fz-l ac-21th lh-24')]' has an invalid token.
【问题讨论】:
-
你能显示包含
class属性的html的sn-p吗?