一、打开一个网页获取所有的内容

from urllib import urlopen
doc = urlopen("http://www.baidu.com").read()
print doc

二、获取Http头

from urllib import urlopen
doc = urlopen("http://www.baidu.com")
print doc.info()
print doc.info().getheader('Content-Type')

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-06
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2021-07-24
相关资源
相似解决方案