Created
October 21, 2021 09:13
-
-
Save satour/9cd78c944bd505e48069fe5d22f0ec8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict' | |
function Report (商品名, 資産評価額, 資産取得額, 効率) { | |
this.商品名 = 商品名 | |
this.資産評価額 = 資産評価額 | |
this.資産取得額 = 資産取得額 | |
this.効率 = 効率 | |
} | |
var 配列 = [] | |
var 運用商品 = document.querySelectorAll('.infoDetailUnit_02') | |
var i = 0 | |
運用商品.forEach(function (item) { | |
var 商品名 = item.children[0].children[0].children[1].innerText | |
var 資産評価額 = | |
item.children[1].children[0].children[0].children[0].children[2] | |
.children[2].innerText | |
var 取得価額累計 = | |
item.children[1].children[0].children[0].children[0].children[2] | |
.children[3].innerText | |
var 数値_資産評価額 = parseInt( | |
資産評価額.replace(',', '').replace('円', '') | |
) | |
var 数値_取得価額累計 = parseInt( | |
取得価額累計.replace(',', '').replace('円', '') | |
) | |
var 効率 = 数値_資産評価額 / 数値_取得価額累計 | |
配列.push(new Report(商品名, 資産評価額, 取得価額累計, 効率)) | |
}) | |
console.table(配列) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment