세포닉
10
2021-05-05 03:26:52
1
66

카톡봇 질문좀 드리겠습니다


카톡봇 처음으로 만들고있는데 갑자기

wrapped java.lang.indexoutofboundsexception inext 1 size 1

이런 오류가 뜨네요 ㅠㅠ 왜이런오류가뜨고 해결방안 좀 알수있을까요??


response = (room, msg, sender, isGroupChat, replier) => {

    var cmd = msg.split(" ");

    if (cmd[0] == "!정보") {

        var data0 = org.jsoup.Jsoup.connect("https://lostark.game.onstove.com/Profile/Character/" + cmd[1]).get();

        var data = data0.select("div.profile-ingame");

        var lv = data.select("div.level-info").select("span");

        var lv_ex = lv.get(1).ownText();

        var lv_ba = lv.get(3).ownText();

        var lv_it = data.select("div.level-info2").select("span").get(1).ownText();

        var info = data.select("div.game-info").select("span");

        var title = info.get(1).text();

        var guild = info.get(3).text();

        var pvp = info.get(5).text();

        var job = data0.select("img.profile-character-info__img").attr("alt");

        var server = data0.select("span.profile-character-info__server").text().replace("@", "");

        var card = data0.select("div.profile-card__content").text();

        var power = data0.select("div.profile-ability-basic").select("span");

        var power_1 = power.get(1).ownText();

        var characteristic = data0.select("div.profile-ability-battle");

        var characteristic_1 = characteristic.get(1).ownText();

        var characteristic_3 = characteristic.get(3).ownText();

        var characteristic_5 = characteristic.get(5).ownText();

        var characteristic_7 = characteristic.get(7).ownText();

        var characteristic_9 = characteristic.get(9).ownText();

        var characteristic_11 = characteristic.get(11).ownText();

        var engrave = data0.select("div.profile-ability-engrave").select("span");

        var result = "이름 : " + cmd[1] +

            "\n직업 : " + job +

            "\n서버 : " + server +

            "\n전투 레벨 : " + lv_ba +

            "\n공격력 : " + power_1 +

            "\n\n특성 \n치명 : "+characteristic_1 + "   특화 : "+ characteristic_3 +

            "\n제압 : "+characteristic_5 + "   신속 : " + characteristic_7 +

            "\n인내 : " + characteristic_9 + "  숙련 : " + characteristic_11 +

            "\n\n원정대 레벨 : " + lv_ex +

            "\n무기 레벨 : " + lv_it +

            "\n칭호 : " + title +

            "\nPVP : " + pvp

+

            "\n카드 : " + card +

            "\n\n각인 " + engrave;

            if (guild != "-") result += "\n길드 : " + guild;

        replier.reply("[로스트아크 캐릭터 정보]\n\n" + result);

    }

}

0
  • 답변 1

  • kenu
    53k
    2021-05-05 04:47:09

    로아는 왜?

  • 로그인을 하시면 답변을 등록할 수 있습니다.