有时候我们需要清洗数据,里面有超链接,怎么去掉他们,比如下面的问题
- Provenance
Brand New Gallery, Milan
Acquired from the above by the present ownerExhibited
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
Follow
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.
第一种方法:
用这则替换,把 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
记录下来,供以后学习参考