ABOUT
Danny Man
I’m Danny, and let me give you a warm welcome to visit my blog site. I hope you’ll enjoy it. Also, you can visit my HOME PAGE to learn more about me.
SEARCH
抓站进行曲
抓站挺好玩的(不过对方心情可就不好说了= =),能够满足某些有趣的需求。Python标准库中的urllib2(在Python3中拆分成urllib.request和urllib.error,这里以Python2作为示例)也很善于做这个事。对于一般的网站来说,请求并获得网页内容是很简单的,借助于urllib2.urlopen两行代码就能搞定:>>> import urllib2
>>> res = urllib2.urlopen('http://www.dannysite.com/blog/...