とあるURLに連続でアクセスする軽い負荷テスト的なものをpythonで書いたのでその時のメモです
クッキーは決め打ちでやっています。
# -*- coding: utf-8 -*- import urllib2 class Application(object): def main(self): url = "http://example.com/?foo=%s&bar=%s" % ('baz', 'qux') opener = urllib2.build_opener() opener.addheaders.append(('Cookie', 'foobar=test_value')) for x in xrange(10): res = opener.open(url) print res.read() if __name__ == '__main__': Application().main()