株式ポートフォリオをスクリプトに読み込もうとしています。以下は NAB Online Trading では機能しますが、Bell Directでは機能しません。
- Export Domain Cookies Firefox アドオンをインストールする
- Firefox でオンライン ブローカーにログインする
- ドメイン Cookie をファイルに保存します (例:
cookies.txt
) wget --no-check-certificate --load-cookies=cookies.txt -O folio.htm https://...
(ポートフォリオURL)
-- ブラウザのログイン セッションを再利用するというアイデア。Bell Direct で試してみるとwget
、ログイン ページにリダイレクトされます。で同じ結果が得られcurl
ます。私は何が欠けていますか?Cookie以外にブラウザに保存されている状態はありますか? ログインページはユーザー名/パスワードのフォームであるため、ベルは「基本認証」を使用していません。ブラウザの組み込みのログインダイアログはポップアップしません。
これは何が起こるかです (Cygwin を使用した Windows XP の場合):
$ wget --server-response --no-check-certificate --load-cookies=cookies-bell.txt -O folio-bell.htm https://www.belldirect.com.au/trade/portfoliomanager/
--2009-12-14 10:52:08-- https://www.belldirect.com.au/trade/portfoliomanager/
Resolving www.belldirect.com.au... 202.164.26.80
Connecting to www.belldirect.com.au|202.164.26.80|:443... connected.
WARNING: cannot verify www.belldirect.com.au's certificate, issued by '/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Server CA/emailAddress=server-certs@thawte.com':
Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response...
HTTP/1.1 302 Found
Connection: keep-alive
Date: Sun, 13 Dec 2009 23:52:16 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Location: /account/login.html?redirect=https://www.belldirect.com.au/trade/portfoliomanager/index.html
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 229
Location: /account/login.html?redirect=https://www.belldirect.com.au/trade/portfoliomanager/index.html [following]
...