public static GEItem getGEItemByName(String itemName) {
        try {
            URL url = new URL("http://services.runescape.com/m=itemdb_rs/results.ws");
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("POST");
            conn.setDoOutput(true);
            conn.setDoInput(true);
            DataOutputStream out = new DataOutputStream(conn.getOutputStream());

            out.writeBytes("query=" + URLEncoder.encode(itemName, "UTF-8"));
            out.flush();
            out.close();
            BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream()));

            String saveFrom = "<table class=\"results\">";
            String saveTill = "</td>";

            String line;
            String content = "";

            boolean save = false;
            while ((line = in.readLine()) != null) {
                if (line.contains(saveFrom))
                    save = true;

                if (save)
                    content += line;

                if (save && line.contains(saveTill))
                    break;
            }
            in.close();

            try {
                Integer.parseInt(content.toLowerCase().replaceFirst(".+obj=(.+?)\">" + itemName.toLowerCase() + "</a>.+", "$1"));
            } catch (Exception e) {
                throw new Exception("Item \"" + itemName + "\" was not found.");
            }

            return GrandExchange.getGEItemByID(Integer.parseInt(content.toLowerCase().replaceFirst(".+obj=(.+?)\">" + itemName.toLowerCase() + "</a>.+", "$1")));
        } catch (Exception e) {
            System.out.println("Error while retrieving an item from the Grand Exchange: " + e.getMessage());
        }
        return null;
    }