text: from urllib.request import urlopen
  from bs4 import BeautifulSoup
  import datetime
  import random
  import re
  random.seed(datetime.datetime.now())
  '''
  从一个维基词条页面随机选取一个连接跳转到另一个维基词条连接
  '''
  
  
  def getLinks(articleUrl):
      html = urlopen("http://en.wikipedia.org"+articleUrl)
      bsObj = BeautifulSoup(html)
      return bsObj.find("div", {"id": "bodyContent"}).findAll("a", href=re.compile("^(/wiki/)((?!:).)*$"))
  links = getLinks("/wiki/Kevin_Bacon")
  while len(links) > 0:
      newArticle = links[random.randint(0, len(links)-1)].attrs["href"]
      print(newArticle)
      links = getLinks(newArticle)
  