Skip to content

Instantly share code, notes, and snippets.

@GZShi
Last active February 23, 2018 01:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GZShi/32ce7bf936cecf120506e290e9f8738e to your computer and use it in GitHub Desktop.
Save GZShi/32ce7bf936cecf120506e290e9f8738e to your computer and use it in GitHub Desktop.
QQ邮箱账单助手数据导出
!function () {
let divs = document.querySelectorAll('.month_row .month_summary')
divs = Array.prototype.slice.call(divs)
let bills = divs.map(div => {
let parent = div.parentElement
let date = parent.id.replace('bill.month_$$', '')
let valNode = div.querySelector('.currency')
let money = valNode.innerText.replace(/\s*¥\s*/g, '').replace(/\s*(人民币)\s*/g, '').replace(',', '')
money = parseFloat(money) || 0
return { date, money }
})
console.log(JSON.stringify(bills))
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment