Beautiful Soup 4.2.0 文檔:https://www.crummy.com/software/BeautifulSoup/bs4/doc/index.zh.html
2021-07-19
pdf 的那塊講解要更新一下了,現(xiàn)在2020年無(wú)法按照視頻中的安裝,使用。
2020-07-02
有一點(diǎn)不太嚴(yán)謹(jǐn),p['paser']不是數(shù)組、列表、元祖,是字典的獲取語(yǔ)法
2020-02-18
for t in soup.find_all('a'): # for循環(huán)遍歷所有a標(biāo)簽,并把返回列表中的內(nèi)容賦給t
print('t的值是:', t) # link得到的是標(biāo)簽對(duì)象
print('t的類(lèi)型是:', type(t))
print('a標(biāo)簽中的href屬性是:', t.get('href')) # 獲取a標(biāo)簽中的url鏈接
print('t的值是:', t) # link得到的是標(biāo)簽對(duì)象
print('t的類(lèi)型是:', type(t))
print('a標(biāo)簽中的href屬性是:', t.get('href')) # 獲取a標(biāo)簽中的url鏈接
2020-01-14
之前講過(guò)的這個(gè)方式
html = urlopen("https://en.wikipedia.org/robots.txt").read().decode("utf-8")
print(html)
爬出來(lái)的結(jié)果,似乎還更有秩序一些?
html = urlopen("https://en.wikipedia.org/robots.txt").read().decode("utf-8")
print(html)
爬出來(lái)的結(jié)果,似乎還更有秩序一些?
2019-11-30
就聽(tīng)見(jiàn)下一個(gè)億萬(wàn)富翁
2018-10-09
我測(cè)試使用story = soup.find( {'class':'story'}) 返回None,使用
story = soup.find( class_='story') 可以正常返回結(jié)果
用的是python 3.7
story = soup.find( class_='story') 可以正常返回結(jié)果
用的是python 3.7
2018-09-30
我根據(jù)老師的代碼,返回的結(jié)果是json字符串,不是HTML,不過(guò)json更好了,都是干凈的數(shù)據(jù)
2018-09-30
如果安裝完畢后還是找不到bs4 直接在 PyCharm 的terminal命令行里面輸入 pip install bs4 完美解決
2018-09-23
在navicat設(shè)計(jì)表的時(shí)候需要把ID設(shè)置為自動(dòng)遞增,不然導(dǎo)入不會(huì)成功的
2018-09-13