爬虫——lxml 模块

使用:
    from lxml import etree
    
    1>本地文件:
        tree = etree.parse("文件名")
    2>网络文件:
        tree = etree.HTML("html字符串")
    tree.xpath("xpath语句")        # 返回一个列表

猜你喜欢

转载自blog.csdn.net/weixin_42598585/article/details/87891760