Skip to content

Instantly share code, notes, and snippets.

@uupaa
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save uupaa/30518eb157cfb48fd071 to your computer and use it in GitHub Desktop.

Select an option

Save uupaa/30518eb157cfb48fd071 to your computer and use it in GitHub Desktop.
AU feature phone device id scraping script

http://www.au.kddi.com/ezfactory/tec/spec/new_win/ezkishu.html

function scraping(rootNode) {
    var trNodes = rootNode.querySelectorAll("tr");
    var lines = [].slice.call(trNodes).map(function(tr) {
        try { 
            return [
                '        "',
                tr.children[1].children[0].textContent,   // DEVICE ID
                '":     [AU,    ',                        // BRAND
                tr.children[13].children[0].textContent,  // Flash Lite Version
                ",    ",
                tr.children[6].children[0].textContent.split("×").sort(function(a,b){return a-b;}).join(","),  // SIZE
                ", ",
                "2.0], // ",                              // BROWSER VERSION
                tr.children[0].children[0].textContent    // MODEL NAME
            ].join("");
        } catch (err) {
            return "";
        }
    });
    console.log( lines.join("\n") );
}

scraping(document.querySelectorAll("table")[7]);
scraping(document.querySelectorAll("table")[8]);

result

        "KC4F":     [AU,    3.0,    233,358, 2.0], // MARVERA
        "KC4D":     [AU,    3.0,    232,325, 2.0], // GRATINA
        "KC4C":     [AU,    3.0,    232,268, 2.0], // mamorino3
        "PT37":     [AU,    3.0,    230,324, 2.0], // PT003
        "KC4A":     [AU,    3.0,    233,358, 2.0], // K011
        "KC4B":     [AU,    3.0,    232,325, 2.0], // K012
        "FJ31":     [AU,    3.0,    233,358, 2.0], // F001
        "SN3V":     [AU,    3.0,    233,358, 2.0], // URBANO AFFARE
        "KC47":     [AU,    0.0,    232,268, 2.0], // Mi-Look
        "TS3Z":     [AU,    3.0,    233,358, 2.0], // T007
        "KC46":     [AU,    3.0,    233,358, 2.0], // K009
        "SN3U":     [AU,    3.0,    233,358, 2.0], // S007
        "TS3Y":     [AU,    3.0,    233,358, 2.0], // T008
        "CA3K":     [AU,    3.0,    232,358, 2.0], // CA007
        "KC45":     [AU,    2.0,    232,325, 2.0], // K010
        "KC44":     [AU,    2.0,    232,268, 2.0], // mamorino2
        "SN3T":     [AU,    3.0,    233,358, 2.0], // G11[iida]
        "PT36":     [AU,    2.0,    230,324, 2.0], // PT002
        "TS3X":     [AU,    3.0,    233,358, 2.0], // T006
        "KC42":     [AU,    3.0,    233,358, 2.0], // K007
        "SH3L":     [AU,    3.0,    234,358, 2.0], // SH011
        "SN3S":     [AU,    3.0,    233,358, 2.0], // S006
        "KC43":     [AU,    2.0,    232,325, 2.0], // K008
        "CA3J":     [AU,    3.0,    232,336, 2.0], // CA006
        "CA3I":     [AU,    3.0,    232,336, 2.0], // G'zOne TYPE-X
        "SH3K":     [AU,    3.0,    232,336, 2.0], // SH010
        "TS3W":     [AU,    3.0,    233,358, 2.0], // X-RAY[iida]
        "SN3Q":     [AU,    3.0,    233,358, 2.0], // S005
        "TS3V":     [AU,    3.0,    233,358, 2.0], // T005
        "SN3R":     [AU,    3.0,    233,358, 2.0], // URBANO MOND
        "KC41":     [AU,    2.0,    232,325, 2.0], // K006 (no camera)
        "SH3J":     [AU,    3.0,    234,358, 2.0], // SH009
        "KC3Z":     [AU,    2.0,    232,325, 2.0], // K006
        "TS3U":     [AU,    3.0,    233,358, 2.0], // LIGHT POOL[iida]
        "KC3Y":     [AU,    2.0,    232,325, 2.0], // K005
        "SH3I":     [AU,    3.0,    234,358, 2.0], // SH008
        "SN3O":     [AU,    3.0,    233,358, 2.0], // S003
        "KC3X":     [AU,    3.0,    233,358, 2.0], // SA002
        "TS3S":     [AU,    3.0,    233,358, 2.0], // T004
        "SN3P":     [AU,    3.0,    233,358, 2.0], // S004
        "HI3H":     [AU,    3.0,    232,336, 2.0], // beskey
        "CA3H":     [AU,    3.0,    232,336, 2.0], // CA005
        "SH3H":     [AU,    3.0,    234,358, 2.0], // SH007
        "KC3W":     [AU,    0.0,    232,268, 2.0], // mamorino
        "SH3G":     [AU,    3.0,    234,358, 2.0], // SH006
        "KC3V":     [AU,    2.0,    232,325, 2.0], // lotta[iida]
        "KC3U":     [AU,    2.0,    232,325, 2.0], // K004
        "SN3N":     [AU,    3.0,    233,358, 2.0], // URBANO BARONE
        "SH3F":     [AU,    3.0,    234,358, 2.0], // SH005
        "SN3L":     [AU,    3.0,    233,358, 2.0], // BRAVIA® Phone U1
        "SH3E":     [AU,    3.0,    233,331, 2.0], // SH004
        "KC3S":     [AU,    2.0,    232,325, 2.0], // PRISMOID[iida]
        "TS3R":     [AU,    3.0,    233,358, 2.0], // T003
        "SH3D":     [AU,    3.0,    234,358, 2.0], // SH003
        "CA3G":     [AU,    2.0,    232,336, 2.0], // CA004
        "SN3M":     [AU,    2.0,    228,345, 2.0], // S002
        "KC3R":     [AU,    3.0,    233,358, 2.0], // SA001
        "CA3F":     [AU,    3.0,    232,336, 2.0], // CA003
        "TS3Q":     [AU,    3.0,    233,358, 2.0], // PLY[iida]
        "KC3P":     [AU,    2.0,    232,325, 2.0], // K003
        "HI3G":     [AU,    3.0,    232,336, 2.0], // Mobile Hi-Vision CAM Wooo
        "KC3Q":     [AU,    2.0,    232,325, 2.0], // misora[iida]
        "TS3O":     [AU,    3.0,    233,358, 2.0], // biblio
        "TS3P":     [AU,    3.0,    233,358, 2.0], // T002
        "SH3B":     [AU,    3.0,    234,358, 2.0], // SH002
        "KC3O":     [AU,    2.0,    232,325, 2.0], // K002
        "SH3C":     [AU,    3.0,    234,358, 2.0], // Sportio water beat
        "CA3E":     [AU,    2.0,    232,333, 2.0], // CA002
        "SN3K":     [AU,    3.0,    232,358, 2.0], // G9[iida]
        "SN3J":     [AU,    3.0,    233,358, 2.0], // S001
        "PT35":     [AU,    2.0,    230,324, 2.0], // NS02
        "MA35":     [AU,    2.0,    233,331, 2.0], // P001
        "TS3N":     [AU,    3.0,    233,331, 2.0], // T001
        "HI3F":     [AU,    3.0,    232,336, 2.0], // H001
        "SH38":     [AU,    3.0,    233,331, 2.0], // SH001
        "CA3D":     [AU,    3.0,    232,336, 2.0], // CA001
        "SN3I":     [AU,    2.0,    233,358, 2.0], // Premier3
        "KC3N":     [AU,    2.0,    232,325, 2.0], // NS01
        "KC3M":     [AU,    2.0,    232,325, 2.0], // K001
        "SN3H":     [AU,    2.0,    233,251, 2.0], // Xmini
        "HI3E":     [AU,    2.0,    232,333, 2.0], // W63H
        "TS3M":     [AU,    2.0,    233,331, 2.0], // W65T
        "CA3C":     [AU,    2.0,    232,333, 2.0], // W63CA
        "SH37":     [AU,    2.0,    228,331, 2.0], // W64SH
        "KC3I":     [AU,    2.0,    232,325, 2.0], // W65K
        "SN3G":     [AU,    2.0,    228,345, 2.0], // W64S
        "MA34":     [AU,    2.0,    232,323, 2.0], // W62P
        "TS3L":     [AU,    2.0,    233,331, 2.0], // W64T
        "KC3K":     [AU,    2.0,    232,325, 2.0], // W63K (no camera)
        "SH36":     [AU,    2.0,    229,323, 2.0], // URBANO
        "PT34":     [AU,    2.0,    230,246, 2.0], // W62PT
        "SA3E":     [AU,    2.0,    230,331, 2.0], // W64SA
        "CA3B":     [AU,    2.0,    232,333, 2.0], // W62CA
        "HI3D":     [AU,    2.0,    232,333, 2.0], // W62H
        "SH35":     [AU,    2.0,    228,331, 2.0], // W62SH
        "SN3F":     [AU,    2.0,    233,331, 2.0], // re
        "KC3H":     [AU,    2.0,    232,325, 2.0], // W63K
        "TS3K":     [AU,    2.0,    229,236, 2.0], // Sportio
        "TS3J":     [AU,    2.0,    233,331, 2.0], // W62T
        "SA3D":     [AU,    2.0,    230,331, 2.0], // W63SA
        "KC3G":     [AU,    2.0,    232,245, 2.0], // W62K
        "SN3D":     [AU,    2.0,    233,331, 2.0], // W61S
        "SA3C":     [AU,    2.0,    230,331, 2.0], // W61SA
        "SN3E":     [AU,    2.0,    228,345, 2.0], // W62S
        "TS3I":     [AU,    2.0,    233,331, 2.0], // W61T
        "HI3C":     [AU,    2.0,    232,323, 2.0], // W61H
        "ST34":     [AU,    2.0,    228,323, 2.0], // W62SA
        "PT33":     [AU,    2.0,    230,240, 2.0], // W61PT
        "MA33":     [AU,    2.0,    232,323, 2.0], // W61P
        "CA3A":     [AU,    2.0,    232,323, 2.0], // W61CA
        "KC3D":     [AU,    2.0,    240,325, 2.0], // W61K
        "SA3B":     [AU,    2.0,    230,331, 2.0], // W54SA
        "SH34":     [AU,    2.0,    229,323, 2.0], // W61SH
        "SN3C":     [AU,    2.0,    233,331, 2.0], // W54S
        "TS3H":     [AU,    2.0,    233,331, 2.0], // W56T
        "TS3G":     [AU,    2.0,    229,245, 2.0], // W55T
        "HI3B":     [AU,    2.0,    232,323, 2.0], // W53H
        "KC3B":     [AU,    2.0,    232,325, 2.0], // W53K/W64K
        "ST33":     [AU,    2.0,    228,323, 2.0], // INFOBAR 2
        "SN3B":     [AU,    2.0,    228,345, 2.0], // W53S
        "CA39":     [AU,    2.0,    232,323, 2.0], // W53CA
        "TS3E":     [AU,    2.0,    229,325, 2.0], // W54T
        "SH33":     [AU,    2.0,    229,323, 2.0], // W52SH
        "CA38":     [AU,    2.0,    232,323, 2.0], // W52CA
        "SN3A":     [AU,    2.0,    228,345, 2.0], // W52S
        "TS3D":     [AU,    2.0,    229,325, 2.0], // W53T
        "SA3A":     [AU,    2.0,    228,323, 2.0], // W52SA
        "HI3A":     [AU,    2.0,    232,323, 2.0], // W52H
        "TS39":     [AU,    2.0,    225,229, 2.0], // DRAPE
        "TS3A":     [AU,    2.0,    225,229, 2.0], // W47T

        "KC48":     [AU,    2.0,    232,325, 2.0], // E10K
        "TS41":     [AU,    3.0,    233,358, 2.0], // E09F
        "TS3T":     [AU,    3.0,    233,358, 2.0], // E08T
        "KC3T":     [AU,    2.0,    232,325, 2.0], // E07K
        "SH3A":     [AU,    2.0,    234,331, 2.0], // E06SH
        "SH39":     [AU,    2.0,    234,331, 2.0], // E05SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment