博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Python 爬虫 数据清洗 去掉 超链接
阅读量:6422 次
发布时间:2019-06-23

本文共 1477 字,大约阅读时间需要 4 分钟。

有时候我们需要清洗数据,里面有超链接,怎么去掉他们,比如下面的问题

Provenance

Brand New Gallery, Milan

Acquired from the above by the present owner

Exhibited

Milan, Brand New Gallery, This is the story of America. Everybody's doing what they think they're supposed to do, November 21, 2013 - January 11, 2014

  • Artist Bio

    Ethan Cook

    American • 1983

    New York-based artist Ethan Cook is known for his abstract paintings on self-produced canvases. More recently, he has used handwoven strips of cotton and linen to create painterly compositions. Cook's woven canvases are contemporary in their minimalist focus on shape and color while referencing one of the most traditional art forms, weaving. Cook weaves his own canvases on a loom and juxtaposes these with  store-bought canvas sheets in abstract arrangements. For the artist, the surface of th e canvas itself becomes the foc us of his practice. Using simple geometric shapes and a l imited color palate, Cook's works nurture structural s implicity.

    View More Works
  •  

     

    第一种方法:

      用这则替换,把 href 替换为 hre1f 就可以了,

    第二种方法:

    result_div_list = re.findall('<(.*?)>',str(result_div))            if 'href' in str(result_div_list):            for ii in result_div_list:                if 'href' in ii:                    item_desc = str(result_div).replace(str(ii) ,'')        else:            item_desc = result_div

    记录下来,供以后学习参考 

     

    转载地址:http://vcpra.baihongyu.com/

    你可能感兴趣的文章
    bzoj2120 数颜色 分块
    查看>>
    几行c#代码,轻松搞定一个女大学生
    查看>>
    UVA 11992 Fast Matrix Operations (降维)
    查看>>
    Asp.net core Identity + identity server + angular 学习笔记 (第一篇)
    查看>>
    暂时不想读研的几点理由
    查看>>
    增加临时表空间组Oracle11g单实例
    查看>>
    Diff Two Arrays
    查看>>
    浅谈java垃圾回收机制
    查看>>
    关于svn和maven结合使用的讨论
    查看>>
    前端第五天
    查看>>
    shell脚本学习之for循环
    查看>>
    MFC用CFile写文件
    查看>>
    stark组件(1):动态生成URL
    查看>>
    169. Majority Element
    查看>>
    Django Form表单学习总结
    查看>>
    大整数加法
    查看>>
    下拉菜单
    查看>>
    C/C++中extern关键字详解
    查看>>
    [清华集训2014]玛里苟斯
    查看>>
    Doctype作用?严格模式与混杂模式如何区分?它们有何意义
    查看>>