- 博客(4)
- 收藏
- 关注
转载 Python partition() 方法
Python partition() 方法 Python 字符串 描述 partition() 方法用来根据指定的分隔符将字符串进行分割。 如果字符串包含指定的分隔符,则返回一个3元的元组,第一个为分隔符左边的子串,第二个为分隔符本身,第三个为分隔符右边的子串。 partiti...
2017-06-01 22:05:00
268
转载 dammit! (靠!)
Unicode, dammit! (靠!) 编码自动检测功能可以在Beautiful Soup以外使用,检测某段未知编码时,可以使用这个方法: from bs4 import UnicodeDammitdammit = UnicodeDammit("Sacr\xc3\xa9 bleu...
2017-05-27 21:26:00
491
转载 BeautifulSoup学习2
.contents 和 .children tag的.contents属性可以将tag的子节点以列表的方式输出: head_tag = soup.headhead_tag# <head><title>The Dormouse's story</tit...
2017-05-27 21:25:00
130
转载 BeatifulSoup学习
Tag对象 soup = BeautifulSoup('<b class="boldest">Extremely bold</b>')tag = soup.btype(tag)# <class 'bs4.element.Tag'> b就是一个tag...
2017-05-27 20:54:00
147
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅