嗯~有时候我们爬取一下内容时是需要爬取到标签哪些的 也就是源码, 但是呢又不是只要HTML的全部源码 只要某个节点下的源码 那就有一个小方法解决
Introduction = tostring(html.xpath("//div[@class='supplier-profile-left-col']")[0]).decode(encoding='utf-8') # 获取介绍源码
嗯~有时候我们爬取一下内容时是需要爬取到标签哪些的 也就是源码, 但是呢又不是只要HTML的全部源码 只要某个节点下的源码 那就有一个小方法解决
Introduction = tostring(html.xpath("//div[@class='supplier-profile-left-col']")[0]).decode(encoding='utf-8') # 获取介绍源码
本文标题:获取某个节点下的源码
本文链接:https://www.haomeiwen.com/subject/nvpbnhtx.html
网友评论