【HSP3】さまざまな検索エンジンに対応したIEコンポーネント自動代入&送信スクリプトサンプル

getElementsByTagNameを使用。

1. getElementsByTagNameでinputタグの要素ノードを検索
2. もしそれがtextだった場合はキーワードを代入
3. inputタグのformタグの要素ノードを取得
4. submitで送信

getElementsByTagNameを使用。

1. getElementsByTagNameでinputタグの要素ノードを検索
2. もしそれがtextだった場合はキーワードを代入
3. inputタグのformタグの要素ノードを取得
4. submitで送信

keyword = "HSP"
sites.0 = "http://www.google.co.jp/", "http://www.yahoo.co.jp/", "http://www.goo.ne.jp/"
sites.3 = "http://www.excite.co.jp/", "http://jp.msn.com/", "http://www.infoseek.co.jp/"
sites.6 = "http://www.livedoor.com/", "http://www.baidu.jp/", "http://www.naver.jp/"
//
randomize
site = sites(rnd(length(sites)))
newcom ie, "InternetExplorer.Application"
ie("Visible")=1
ie->"Navigate" site
mes site
repeat
wait 10 : if( ie("Busy") == 0 ) { break }
loop
o = ie("Document")
repeat
wait 10 : if( o("readyState") == "complete" ) { break }
loop
pDoc = ie("Document")
comres pInputs
// input
pDoc->"getElementsByTagName" "input"
num = pInputs("length")
repeat num
pInput = pInputs("item", cnt)
// type
comres type
pInput->"getAttribute" "type"
// type = text
if type == "text" {
//
pInput("value") = keyword
// form
pFrom = pInput("form")
//
pFrom->"submit"
break
}
loop
delcom pFrom
delcom pInput
delcom pInputs
delcom pDoc
delcom ie
end
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX