Display.SelectFolder Description: $'''作業フォルダの選択''' IsTopMost: False SelectedFolder=> SelectedFolder ButtonPressed=> ButtonPressed Display.SelectFileDialog.SelectFile Title: $'''「EDINET検索リスト.xlsx」の選択''' InitialDirectory: SelectedFolder FileFilter: $'''*.xlsx''' IsTopMost: True CheckIfFileExists: True SelectedFile=> SelectedFileList ButtonPressed=> ButtonPressed Display.InputDialog Title: $'''保存ファイル名の指定''' Message: $'''上書き保存する場合は、そのままOKを押してください''' DefaultValue: SelectedFileList.Name InputType: Display.InputType.SingleLine IsTopMost: False UserInput=> SaveFileListName ButtonPressed=> ButtonPressed Display.InputDialog Title: $'''保存先フォルダ名の入力''' Message: $'''作業フォルダ直下に作成する保存先フォルダ名を指定してください''' DefaultValue: $'''output''' InputType: Display.InputType.SingleLine IsTopMost: False UserInput=> SaveFolderName ButtonPressed=> ButtonPressed Folder.Create FolderPath: SelectedFolder FolderName: SaveFolderName Folder=> SaveFolder SET StartRow TO 3 SET StartColumn TO 2 Excel.LaunchExcel.LaunchAndOpen Path: SelectedFileList Visible: True ReadOnly: False LoadAddInsAndMacros: False Instance=> ExcelInstance Excel.SetActiveWorksheet.ActivateWorksheetByName Instance: ExcelInstance Name: $'''EDINET検索リスト''' Excel.GetFirstFreeColumnRow Instance: ExcelInstance FirstFreeColumn=> FirstFreeColumn FirstFreeRow=> FirstFreeRow Excel.ReadFromExcel.ReadCells Instance: ExcelInstance StartColumn: StartColumn StartRow: StartRow EndColumn: FirstFreeColumn - 1 EndRow: FirstFreeRow - 1 ReadAsText: False FirstLineIsHeader: True RangeValue=> ExcelData LOOP LoopIndex FROM 0 TO ExcelData.RowsCount - 1 STEP 1 Display.ShowMessageDialog.ShowMessageWithTimeout Title: $'''【%LoopIndex + 1%/%ExcelData.RowsCount%】 検索''' Message: $'''EDINETコード%ExcelData[LoopIndex]['EDINETコード']% 証券コード%ExcelData[LoopIndex]['証券コード']%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False Timeout: 2 ButtonPressed=> ButtonPressed WebAutomation.LaunchEdge.LaunchEdgeCloseDialog Url: $'''https://disclosure.edinet-fsa.go.jp/E01EW/BLMainController.jsp?uji.verb=W0EZA230CXP002010BLogic&uji.bean=ee.bean.parent.EECommonSearchBean&PID=currentPage&TID=W1E63020&SESSIONKEY=1643345851313&lgKbn=2&pkbn=0&skbn=1&dskb=&askb=&dflg=0&iflg=0&preId=1&sec=&scc=9999&shb=&snm=&spf1=1&spf2=1&iec=&icc=&inm=&spf3=1&fdc=&fnm=&spf4=1&spf5=2&otd=120&cal=1&era=R&yer=&mon=&psr=1&pfs=4&row=0&idx=0&str=&kbn=1&flg=&syoruiKanriNo=''' WindowState: WebAutomation.BrowserWindowState.Normal ClearCache: False ClearCookies: False Timeout: 60 BrowserInstance=> Browser WebAutomation.PressButton.PressButtonCloseDialog BrowserInstance: Browser Control: appmask['EDINET書類詳細検索画面']['「書類種別を指定する」を開く'] WebAutomation.SelectRadioButton.SelectRadioButtonCloseDialog BrowserInstance: Browser Control: appmask['EDINET書類詳細検索画面']['ラジオボタン「書類種別を指定する」'] WebAutomation.SetCheckboxState.SetCheckboxStateCloseDialog BrowserInstance: Browser Control: appmask['EDINET書類詳細検索画面']['チェックボックス「有価証券報告書」'] State: WebAutomation.CheckboxState.Checked WebAutomation.PopulateTextField.PopulateTextFieldCloseDialog BrowserInstance: Browser Control: appmask['EDINET書類詳細検索画面']['入力フィールド「提出者EDINETコード」'] Text: ExcelData[LoopIndex]['EDINETコード'] EmulateTyping: True UnfocusAfterPopulate: False Mode: WebAutomation.PopulateTextMode.Replace WebAutomation.PopulateTextField.PopulateTextFieldCloseDialog BrowserInstance: Browser Control: appmask['EDINET書類詳細検索画面']['入力フィールド「提出者証券コード」'] Text: ExcelData[LoopIndex]['証券コード'] EmulateTyping: True UnfocusAfterPopulate: False Mode: WebAutomation.PopulateTextMode.Replace WebAutomation.PressButton.PressButtonCloseDialog BrowserInstance: Browser Control: appmask['EDINET書類詳細検索画面']['検索ボタン'] WebAutomation.GetDetailsOfElement BrowserInstance: Browser Control: appmask['検索後']['検索結果'] AttributeName: $'''Own Text''' AttributeValue=> SearchResult IF Contains(SearchResult, $'''存在しません''', True) THEN NEXT LOOP END WebAutomation.GetDetailsOfElement BrowserInstance: Browser Control: appmask['検索後']['提出日時'] AttributeName: $'''Own Text''' AttributeValue=> TeishutsuDate WebAutomation.GetDetailsOfElement BrowserInstance: Browser Control: appmask['検索後']['提出書類'] AttributeName: $'''Own Text''' AttributeValue=> TeishutsuDocument WebAutomation.GetDetailsOfElement BrowserInstance: Browser Control: appmask['検索後']['提出者/ファンド'] AttributeName: $'''Own Text''' AttributeValue=> TeishutsuFund # 改行コードの削除 Text.Replace Text: TeishutsuDate TextToFind: $'''\\r\\n''' IsRegEx: True IgnoreCase: False ReplaceWith: $'''%''%''' ActivateEscapeSequences: False Result=> TeishutsuDate Text.Replace Text: TeishutsuDocument TextToFind: $'''\\r\\n''' IsRegEx: True IgnoreCase: False ReplaceWith: $'''%''%''' ActivateEscapeSequences: False Result=> TeishutsuDocument Text.Replace Text: TeishutsuFund TextToFind: $'''\\r\\n''' IsRegEx: True IgnoreCase: False ReplaceWith: $'''%''%''' ActivateEscapeSequences: False Result=> TeishutsuFund SET ExcelData[LoopIndex]['提出日時'] TO TeishutsuDate SET ExcelData[LoopIndex]['提出書類'] TO TeishutsuDocument SET ExcelData[LoopIndex]['提出者/ファンド'] TO TeishutsuFund SET SaveFilePath TO $'''%SaveFolder%\\有価証券報告書_%ExcelData[LoopIndex]['証券コード']%_%TeishutsuFund%.pdf''' # Excelシートに書き込む Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: TeishutsuDate Column: 4 Row: StartRow + LoopIndex + 1 Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: TeishutsuDocument Column: 5 Row: StartRow + LoopIndex + 1 Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: TeishutsuFund Column: 6 Row: StartRow + LoopIndex + 1 Excel.WriteToExcel.WriteCell Instance: ExcelInstance Value: SaveFilePath Column: 7 Row: StartRow + LoopIndex + 1 IF (WebAutomation.IfWebPageContains.WebPageDoesNotContainElement BrowserInstance: Browser Control: appmask['検索後']['PDF']) THEN Display.ShowMessageDialog.ShowMessageWithTimeout Title: $'''証券コード%ExcelData[LoopIndex]['証券コード']%''' Message: $'''検索結果にPDFファイルが存在しません。 次のループに移ります。''' Icon: Display.Icon.Warning Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False Timeout: 5 ButtonPressed=> ButtonPressed NEXT LOOP END WebAutomation.GetDetailsOfElement BrowserInstance: Browser Control: appmask['検索後']['PDF'] AttributeName: $'''HRef''' AttributeValue=> PDFURL WebAutomation.LaunchEdge.LaunchEdgeCloseDialog Url: PDFURL WindowState: WebAutomation.BrowserWindowState.Normal ClearCache: False ClearCookies: False Timeout: 60 BrowserInstance=> PDFBrowser MouseAndKeyboard.SendKeys.FocusAndSendKeysByInstanceOrHandle WindowInstance: PDFBrowser TextToSend: $'''{Control}({S})''' DelayBetweenKeystrokes: 10 SendTextAsHardwareKeys: False WAIT (UIAutomation.WaitForWindowContent.WindowToContainElement Element: appmask['名前を付けて保存']['入力フィールド「ファイル名」']) UIAutomation.PopulateTextField TextField: appmask['名前を付けて保存']['入力フィールド「ファイル名」'] Text: SaveFilePath Mode: UIAutomation.PopulateTextMode.Replace ClickType: UIAutomation.PopulateMouseClickType.SingleClick UIAutomation.Click Element: appmask['名前を付けて保存']['Button \'保存(S)\''] ClickType: UIAutomation.ClickType.LeftClick MousePositionRelativeToElement: UIAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 # 同じファイルが存在する場合は上書き保存する IF (UIAutomation.IfWindow.IsOpen Window: appmask['名前を付けて保存の確認']['Button \'はい(Y)\'']) THEN UIAutomation.Click Element: appmask['名前を付けて保存の確認']['Button \'はい(Y)\''] ClickType: UIAutomation.ClickType.LeftClick MousePositionRelativeToElement: UIAutomation.RectangleEdgePoint.MiddleCenter OffsetX: 0 OffsetY: 0 END # ダウンロードに時間がかかる可能性を考慮してWaitを入れる WAIT 2 # ブラウザを閉じる WebAutomation.CloseWebBrowser BrowserInstance: PDFBrowser WebAutomation.CloseWebBrowser BrowserInstance: Browser END Excel.CloseExcel.CloseAndSaveAs Instance: ExcelInstance DocumentFormat: Excel.ExcelFormat.OpenXmlWorkbook DocumentPath: $'''%SelectedFolder%\\%SaveFileListName%''' Display.ShowMessageDialog.ShowMessage Title: $'''メッセージ''' Message: $'''終了しました''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: False ButtonPressed=> ButtonPressed # [ControlRepository][PowerAutomateDesktop] { "ApplicationInfo": { "Name": "ClipboardControlRepository", "Version": "1.0" }, "Screens": [ { "Controls": [ { "AutomationProtocol": "uia3", "ElementTypeName": "
", "InstanceId": "7685bdc3-5783-41bf-9925-48bc9816d6e7", "Name": "「書類種別を指定する」を開く", "SelectorCount": 1, "Selectors": [ { "CustomSelector": null, "Elements": [ { "Attributes": [ { "Ignore": false, "IsOrdinal": false, "Name": "Class", "Operation": "EqualTo", "Value": "etsuran innerpage" }, { "Ignore": true, "IsOrdinal": false, "Name": "Id", "Operation": "EqualTo", "Value": null }, { "Ignore": true, "IsOrdinal": true, "Name": "Ordinal", "Operation": "EqualTo", "Value": -1 }, { "Ignore": true, "IsOrdinal": false, "Name": "Title", "Operation": "EqualTo", "Value": null } ], "CustomValue": null, "Ignore": true, "Name": "
'ヘルプ 閲覧 検索 書類簡易検索 書類詳細検索 全文検索 比較 書類情報比較 書類詳細検索画面 ... Government Copyright ?金融庁 All Rights Reserved.'", "Tag": "body" }, { "Attributes": [ { "Ignore": true, "IsOrdinal": false, "Name": "Class", "Operation": "EqualTo", "Value": null }, { "Ignore": false, "IsOrdinal": false, "Name": "Id", "Operation": "EqualTo", "Value": "ci" }, { "Ignore": true, "IsOrdinal": true, "Name": "Ordinal", "Operation": "EqualTo", "Value": -1 }, { "Ignore": true, "IsOrdinal": false, "Name": "Title", "Operation": "EqualTo", "Value": null } ], "CustomValue": null, "Ignore": true, "Name": "