2012年8月8日水曜日

FileMakerからInternet Explorerを操作して郵便番号から住所を取得

FileMakerからInternet Explorerを操作して郵便番号から住所を取得!

カスタム関数「GetByClassName」を作ったので class="data" とかなっているタグのテキストの取得がカンタンになりました。


郵便番号検索 - 日本郵便 : http://www.post.japanpost.jp/zipcode/index.html
から郵便番号で検索して住所を取得します。

スクリプト名:GET郵便番号から住所(郵便番号)

変数を設定 [$zip; 値:Get(スクリプト引数)]
変数を設定 [$er; 値:Navigate_CreateObject ( "http://www.post.japanpost.jp/cgi-zip/zipcode.php?zip="  & $zip)]
変数を設定 [$er; 値:Wait4ie]
変数を設定 [$郵便番号; 値:GetByClassName ( "data" ; 0 ; "innerText" )]
変数を設定 [$都道府県; 値:GetByClassName ( "data" ; 1 ; "innerText" )]
変数を設定 [$市区町村; 値:GetByClassName ( "data" ; 2 ; "innerText" )]
変数を設定 [$町域; 値:GetByClassName ( "data" ; 3 ; "innerText" )]


「Navigate_CreateObject 」「GetByClassName」は、カスタム関数

要プラグイン
ScriptMakerMS
https://sites.google.com/site/scriptmakerms/scriptmakerms

要カスタム関数
WFM.fp7(ファイル内)
https://sites.google.com/site/scriptmakerms/scriptmakerms/web-scraping

動作環境
OS:Xp , 7
FileMaker 11

0 件のコメント:

コメントを投稿