crac

导航

no.1

#import requests
import urllib
import bs4
try:
    html=urllib.urlopen('http://anyun.org')
except HTTPerror as e:
    print(e)
    print('xxxx')
else:
    bsobj = bs4.BeautifulSoup(html.read())
    #print (html.read())
    try:
        namelist = bsobj.findall("li",{"color":"#ff0000"})
    except TypeError as b:
        print(b)
    else:
        print (namelist)
    #print (bsobj.div.lum111)
    #print('aa')

 

posted on 2016-04-28 01:08  crac  阅读(168)  评论(0编辑  收藏  举报