def notice_content(url):
 try:
  html = lxml.html.parse(url)
  res = html.xpath('//div[@id="content"]/pre/text()')[0]
  return res.strip()
 except Exception as er:
  print str(er)

def notice_content ( url ) : try : html = lxml . html . parse ( url ) res = html . xpath ( '//div[@id="content"]/pre/text()' ) [ 0 ] return res . strip ( ) except Exception as er : print str ( er )
parameter url:内容链接 return string:信息内容 .