美文网首页
获取某个节点下的源码

获取某个节点下的源码

作者: 叶叶阿姨 | 来源:发表于2020-05-12 15:08 被阅读0次

嗯~有时候我们爬取一下内容时是需要爬取到标签哪些的 也就是源码, 但是呢又不是只要HTML的全部源码 只要某个节点下的源码 那就有一个小方法解决

Introduction = tostring(html.xpath("//div[@class='supplier-profile-left-col']")[0]).decode(encoding='utf-8')  # 获取介绍源码

相关文章

网友评论

      本文标题:获取某个节点下的源码

      本文链接:https://www.haomeiwen.com/subject/nvpbnhtx.html