//免責事項 //当サイト及び管理人は本スクリプトを使用し、またはその結果の利用により利用者または //第三者に生じた損害や不利益について一切その責任を負いません。 //エクセル関数呼び出し Public IE call ExcelConst.uws 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://points.yahoo.co.jp/book") CTRLWIN(IEID, CLOSE) BusyWait(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) or POS("ポイント通帳",IE.document.title)> 0 busywait(ie) IE.navigate("https://points.yahoo.co.jp/book") //busywait(ie) sleep(1) //Tポイント取得 pointobj = IE.document.getElementsByclassname("typeTotal typeBdr4B") pointtotal = pointobj.item(0).innertext print pointtotal //余計な改行と文字列を削除 pointtotal = REPLACE(pointtotal,"<#CR>","") pointtotal = REPLACE(pointtotal,"失効まで30日以内のポイントがあります","") pointtotal = REPLACE(pointtotal,"入会&利用でもれなく最大10,000ポイント進呈","") pointobj = IE.document.getElementsByclassname("totalPoint") pointtsujo = pointobj.item(0).innertext limitedpoint = pointobj.item(1).innertext print pointtsujo pointobj = IE.document.getElementsByclassname("typeBdrDshB") tsujoexpiration = pointobj.item(0).innertext print tsujoexpiration pointobj = IE.document.getElementsByclassname("summary__dateCell-red") if length(pointobj.item(0)) = 1 then pointobj = IE.document.getElementsByclassname("summary__dateCell") endif limitedexpiration = pointobj.item(0).innertext //エクセルに書き込み excel.activecell.offset(0,4).value = pointtotal excel.activecell.offset(0,5).value = pointtsujo excel.activecell.offset(0,6).value = tsujoexpiration excel.activecell.offset(0,7).value = limitedpoint excel.activecell.offset(0,8).value = limitedexpiration 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)