随笔分类 - python数据抓取
摘要:import timeimport requestsfrom bs4 import BeautifulSoupimport threadingdef format_str(s): return s.replace("\n","").replace("","").replace("\t",'')def
阅读全文
摘要:json import requestsimport jsonurl="https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=na&json=1&p=3&sid=1459_19036_21110_25227_25436_25178&req=2
阅读全文
摘要:查找网页中<a>标签中的链接from bs4 import BeautifulSoupwith open('beautifulSoup_test.html','r',encoding='utf-8')as f: #beautifulSoup_test.html是同级网页源代码 bs=Beautifu
阅读全文
摘要:import randomrandom.seed(20)print(random.random())random.seed(10) #random.seed()指定随机数,与下面的相同的种子值print(random.random())random.seed(20)print(random.rand
阅读全文

浙公网安备 33010602011771号