Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save satour/9cd78c944bd505e48069fe5d22f0ec8e to your computer and use it in GitHub Desktop.
Save satour/9cd78c944bd505e48069fe5d22f0ec8e to your computer and use it in GitHub Desktop.
(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