立即学习:https://edu.csdn.net/course/play/26899/344223?utm_source=blogtoedu

1、正则表达式re和XPath都是用于正则的提取,re的功能更强大;

2、XPath语法

学习笔记(09):5天Python闯关训练营-104期-XPath语法与案例

 

3、提取CSDN官网的一级分类和二级分类的XPath代码:

一级分类://h3[@class=”classify_c_h3”]/a/text()

二级分类://div[@class=”classify_list”]/span/a/text()

          //div[contain( @class,”classify_list”)]/span/a/text()

相关文章:

  • 2021-05-16
  • 2021-04-17
  • 2021-05-07
  • 2021-06-03
  • 2021-05-25
  • 2021-04-08
  • 2021-06-19
  • 2022-12-23
猜你喜欢
  • 2021-06-21
  • 2021-05-20
  • 2021-04-11
  • 2021-12-24
  • 2021-06-13
  • 2021-11-30
  • 2021-12-16
相关资源
相似解决方案