以urllib2.Request方式获取url源码,并通过设置User-Agent实现了简单的可抓取反爬虫站点。
url页面源码,失败返回None。
print star.fetchurl('http://blog.csdn.net/asmcvc')
There was an error while loading. Please reload this page.