//免責事項 //当サイト及び管理人は本スクリプトを使用し、またはその結果の利用により利用者または //第三者に生じた損害や不利益について一切その責任を負いません。 EXCELWINDOW = GETID(status(GETID(GET_ACTIVE_WIN),st_title)) EXCEL = GETACTIVEOLEOBJ("Excel.Application") EXCEL.visible = True //IE初期設定 IEtemp = CREATEOLEOBJ("InternetExplorer.Application") IEtemp.visible = true sleep(2) IEID = GETID("Internet Explorer") CTRLWIN(IEID, ACTIVATE) //inPrivateモードで起動。ログアウト状態から始めたいため。 SCKEY(IEID, VK_CTRL, VK_SHIFT, VK_P) sleep(2) IE = getactiveOLEOBJ("InternetExplorer.Application","inPrivate") IE.navigate("https://auctions.yahoo.co.jp/topic/promo/kuji/") CTRLWIN(IEID, CLOSE) BusyWait(IE) IELINK(IE,"ログイン") //YahooIDの数だけ繰り返す。 scellrow = VAL(EXCEL.ActiveCell.Row) ecellrow = VAL(COPY(EXCEL.ActiveCell.End(-4121).Address(),4)) LOOPCNTEND = ecellrow - scellrow + 1 //LOOPCNTENDの数だけ繰り返す。 //YahooID 1個だけ処理すると数万回繰り返すのでLOOPCNTENDを調整。 IF LOOPCNTEND > 100000 THEN LOOPCNTEND = 1 else endif CNT = 1 //ループ開始 WHILE CNT <= LOOPCNTEND yahooid = excel.activecell.value yahoopass = excel.activecell.offset(0,1).value iesetdata(IE,yahooid,"login") iesetdata(IE,true,"btnNext") sleep(0.5) iesetdata(IE,yahoopass,"passwd") iesetdata(IE,true,"btnSubmit") busywait(ie) //TカードやYahooカード勧誘をスキップ REPEAT IESETDATA(IE,true,"cancel") IELINK(IE,"このページをスキップ") IELINK(IE,"ご利用中のサービスに戻る") IELINK(IE,"あとで確認する") sleep(0.1) UNTIL POS("びっくりサンデー",IE.document.title) > 0 IELINK(IE,"今すぐチャレンジ") //ALL_LINK = IE.Document.links.length //FOR i = 0 TO (ALL_LINK - 1) //IFB POS("今すぐチャレンジ", IE.Document.links[i].href) > 0 //IE.Document.links[i].Click() //ENDIF //NEXT sleep(7) pointobj = IE.document.getElementsByclassname("KeyVisualResult__body KeyVisualResult__body--win") if pointobj.length = 0 point = "はずれ" else pointichi = POS("per<#DBL>", pointobj.item(0).innerhtml) - 195 point = copy(pointobj.item(0).innerhtml, 198, pointichi) endif ifb point = "KeyVisualResult__result KeyVisualResult__result--50per" then pointrate = "50%" elseif point = "KeyVisualResult__result KeyVisualResult__result--10per" then pointrate = "10%" elseif point = "KeyVisualResult__result KeyVisualResult__result--5per" then pointrate = "5%" else pointrate = "はずれ" endif excel.activecell.offset(0,2).value = pointrate sleep(2) IELINK(IE,"ログアウト") BusyWait(ie) Excel.activecell.offset(1,0).select IELINK(IE,"再度ログインする") CNT = CNT + 1 WEND Procedure BusyWait(ie) Sleep(0.5) // Wait Const TIME_OUT = 90 tm = Gettime() repeat Sleep(0.2) ifb Gettime() - tm > TIME_OUT MsgBox("Time Out:BusyWait") ExitExit endif until (! ie.busy) and (ie.readyState=4) Sleep(0.5) Fend IE.Navigate("about:blank") // INPUT BusyWait(IE)