- 博客(2)
- 收藏
- 关注
原创 Beautifulsoup使用
file = open('baidu.html', 'rb') html = file.read() bs = BeautifulSoup(html, 'html.parser') print(bs.title) print(bs.a) print(bs.head) 1、获得标签内的字符串 print(bs.title.string) 2、获得标签内的属性 print(bs.a.attrs) 3、获得整个文档,bs print(bs) 4、获得注释 print(bs.a.string) --
2020-06-10 11:21:45 117
原创 (可能是)自创的下标排序法
今天学习算法中各类排序法,发现时间复杂度基本上都是O(n**2) 突发奇想到一个比较浪费空间但省时间的排序算法,其实也不知道意义何在,但记录一下博君一笑 代码如下: #!/usr/bin/env python # -*- coding: utf-8 -*- #需要排序的a列表 alist = [433, 198, 389, 456, 216, 21, 133, 495, 262, 249, 208, 471, 402, 425, 156, 496, 245, 184, 299, 457] ma
2020-05-27 23:58:34 339
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人