最近项目需要从网络上抓取一下数据解析Html源码,奈何正则表达式难写,于是网上搜索找到了“ HtmlAgilityPack”类库,敏捷开发,果然效率非同寻常。

 在此做笔记,写下心得,顺便给自己总结一下。

 1、 HtmlAgilityPack使用的是XPath进行路径搜索,如果对XML路径搜索很熟悉,用起来会得心应手

<?xml version="1.0" encoding="ISO-8859-1"?>

<bookstore>

<book>
  <title lang="eng">Harry Potter</title>
  <price>29.99</price>
</book>

<book>
  <title lang="eng">Learning XML</title>
  <price>39.95</price>
</book>

</bookstore>
View Code

相关文章:

  • 2021-09-04
  • 2021-06-06
  • 2021-09-28
  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
猜你喜欢
  • 2021-09-12
  • 2021-11-03
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案