【python challenge】level2

__author__ = 'user'
# -*- coding:utf-8 -*-
import requests
import urllib2
import re
def enchar():
    url = 'http://www.pythonchallenge.com/pc/def/ocr.html'
    request = urllib2.Request(url)

    respnose = urllib2.urlopen(request)
    pagecode = respnose.read().decode('utf-8')
    print pagecode
    pattern = re.compile('[a-zA-Z]+')
    items = re.findall(pattern,pagecode)
    print items
enchar()

你可能感兴趣的:(python)