>>前スレ986 ( pc11.2ch.net/test/read.cgi/software/1176677869/986 ) クリックだとページ変遷が発生しないか? a 要素の target 属性に _blank とか指定されてたら別だが // 親要素が a の img 要素で src 属性値に特定の文字列が含まれるものをすべてクリック // 変数 ie には対象の IE オブジェクトが代入されているものとする DIM str = "http://〜〜〜/Apos/img/web/10174" DIM imgelmlst = ie.Document.images DIM imgelm, elm, i
FOR i=0 TO imgelmlst.length-1 imgelm = imgelmlst.item(i) elm = imgelm.parentElement IF elm.tagName <> "A" THEN CONTINUE IFB POS(str, imgelm.src) THEN imgelm.click() //navigate_new_window(elm.href) ENDIF NEXT
FUNCTION navigate_new_window(uri, iswait=FALSE) DIM ie = CREATEOLEOBJ("InternetExplorer.Application")
ie.Visible = TRUE ie.Navigate(uri) RESULT = ie IF !iswait THEN EXIT
REPEAT SLEEP(0.1) UNTIL !ie.Busy AND (ie.ReadyState = 4) FEND