Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?

It's now long time since my last post. This surely does not means that I'm stopping FAPWS, at contrary I'm more and more convinced that one of the beauty of Python reside in his gluing capabilities. This observation is probably not new to lot of people, but for my personal case it's better now than never ;-), no ? After that small philosophical intro, please go back to our main interest: integrate
備忘録:PythonでHTTPのDigest認証を行うをほとんどそのまま。忘れないようにメモ。Python Challengeのある問題で大変役立った。 import urllib2 top_url = "www.foo.org" url = "www.foo.org/bar.html" username = "user" password = "pass" passman = urllib2.HTTPPasswordMgrWithDefaultRealm() passman.add_password(None, top_url, username, password) authhandler = urllib2.HTTPBasicAuthHandler(passman) opener = urllib2.build_opener(authhandler) urllib2.install_
「HTTPリクエストの作法を学びましょう」 Pythonでウェブコンテンツへアクセスするための第一歩。 % python >>> import urllib >>> url = 'http://www.google.com' >>> filehandle = urllib.urlopen(url) >>> data = filehandle.read() >>> print data % python >>> import urllib >>> proxies = proxies={'http': 'http://192.168.0.1:8080'} >>> url = 'http://www.google.com' >>> filehandle = urllib.urlopen(url, proxies=proxies) >>> data = filehandle.read() >>
「どうやって行けばいいの?」 Pythonではまっているのが、ウェブリソースへのアクセス。 社内の開発環境で試したいのだが、ウェブへはProxy経由でなければならない社内事情により、常にProxyを意識しなければならない面倒さ加減。 別に、コンテンツフィルタリングもログ監視/解析もしてないのだから、PATでアクセスさせてもらいたいなぁ。 参考サイト:URLによる任意のリソースアクセス % python >>> proxies = proxies={'http': 'http://Proxyアドレス:ポート'} >>> filehandle = urllib.urlopen('対象サイト', proxies=proxies) >>> data = filehandle.read() >>> print filehandle
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く