Skip to content

Instantly share code, notes, and snippets.

@nrm176
Last active July 27, 2020 08:37
Show Gist options
  • Save nrm176/1d53eeca49099f2dacfff3b04346937b to your computer and use it in GitHub Desktop.
Save nrm176/1d53eeca49099f2dacfff3b04346937b to your computer and use it in GitHub Desktop.
Array.from(document.querySelectorAll('div#header_v tr')).map((e) => {
    return Array.from(e.querySelectorAll('td')).map((e) => {
        return e.textContent
    })
}).filter((e, idx) => {
    return e.length === 4
}).filter((e) => {
    return e[1].length === 5
}).map((e) => {
    return {hs4: e[1], desc: e[3].trim()}
})
@nrm176
Copy link
Author

nrm176 commented Jul 27, 2020

[
  {
    "hs4": "01.01",
    "desc": "馬、ろ馬、ら馬及びヒニー(生きているものに限る。)"
  },
  {
    "hs4": "01.02",
    "desc": "牛(生きているものに限る。)"
  },
  {
    "hs4": "01.03",
    "desc": "豚(生きているものに限る。)"
  },
  {
    "hs4": "01.04",
    "desc": "羊及びやぎ(生きているものに限る。)"
  },
  {
    "hs4": "01.05",
    "desc": "家きん(鶏(ガルルス・ドメスティクス)、あひる、がちよう、七面鳥及びほろほろ鳥で、生きているものに限る。)"
  },
  {
    "hs4": "01.06",
    "desc": "その他の動物(生きているものに限る。)"
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment