#coding=utf8 import urllib, BeautifulSoup web=urllib.urlopen("http://whatweekisit.com/")
soup=BeautifulSoup.BeautifulSoup(web.read()) for i in soup.findAll("td")[:6]:
print i.text
结果:
Today's date is:
Saturday, November 15th, 2014
Week of the year:
46 of 52
Day of the year:
319 of 365