資源簡介
python爬蟲,抓取百度貼吧中的郵箱地址,如有環(huán)境安裝問題請私信我
代碼片段和文件信息
#?coding=utf-8
import?re
import?requests
import?sys
reload(sys)
sys.setdefaultencoding(‘utf-8‘)
from?bs4?import?BeautifulSoup
#?獲取html文檔
def?get_html(url):
????“““get?the?content?of?the?url“““
????response?=?requests.get(url)
????response.encoding?=?‘utf-8‘
????return?response.text
????
#?獲取笑話
def?get_certain_joke(html):
????“““get?the?joke?of?the?html“““
????soup?=?B
評(píng)論
共有 條評(píng)論