Loading

摘要: 一、xpath选择器 XPath 是一门在 XML 文档中查找信息的语言 /: ——># 从根节点选取: //: ——># 不管位置,直接找 /@属性名 ——># 获取对应属性值 /text() ——># 获取文本内容 使用方式: from lxml import etree html = etre 阅读全文
posted @ 2021-08-22 18:54 Mr-Yang` 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 一、介绍 Beautiful Soup 主要是用来解析提取 HTML 和 XML 文件中的数据。 现在官网推荐使用 Beautiful Soup 4 ,已经被移植到了BS4中。 安装 Beautiful Soup:pip instal beautifulsoup4 使用格式: 实例化 Beautif 阅读全文
posted @ 2021-08-22 18:35 Mr-Yang` 阅读(574) 评论(0) 推荐(0) 编辑