mac python 爬取段子

看看我们要达到的目的

mac python 爬取段子_第1张图片
E6F758B1-DD5E-40FE-97F4-BD377A3D2570.png

1.下载PYCHARM
PYcharm


#coding=utf-8

import sys
import re
import urllib




def gethtml(url):
    page = urllib.urlopen(url)
    html = page.read()
    return html


def getmessage(html):

    p = re.compile(r'
(.*)

你可能感兴趣的:(mac python 爬取段子)