Nós XPath vêm após nova linha

Estou tentando obter o texto do nó para os nós que têm o centro de alinhamento div: `

                <tr> 
                  <td width="39" class="back1"><b class="texto4">CRN</b></td>
                  <td width="60" class="back1"><b class="texto4">Materia</b></td>
                  <td width="53" class="back1"><b class="texto4">Secci&oacute;n</b></td>
                  <td width="55" class="back1"><b class="texto4">Cr&eacute;ditos</b></td>
                  <td width="156" class="back1"><b class="texto4">T&iacute;tulo</b></td>
                  <td width="69" class="back1"><b class="texto4">Cupo</b></td>
                  <td width="57" class="back1"><b class="texto4">Inscritos</b></td>
                  <td width="77" class="back1"><b class="texto4">Disponible</b></td>
                </tr>
                <tr> 
                  <td width="39"><font class="texto4"> 
                    10110                        </font></td>
                  <td width="60"><font class="texto4"> 
                    IIND1000                        </font></td>
                  <td width="53"><font class="texto4"> 
                  <div align="center">
                    1                        </div></font></td>
                  <td width="55"><font class="texto4"> 
                    <div align="center">
                    3                       </div>
                    </font></td>
                  <td width="156"><font class="texto4"> 
                    INTROD. INGEN. INDUSTRIAL                        </font></td>
                  <td width="69"><font class="texto4"> 
                    100                        </font></td>
                  <td width="57"><font class="texto4"> 
                    100                        </font></td>
                  <td width="77"><font class="texto4"> 
                    0                        </font></td>
                </tr>
              </table> `

O problema é que o JTidy não recebe o texto nesse nó filho porque (presumo aqui) há uma nova linha entre<font class="texto4"> e<div align="center">. A saída quando eu recebo todos os elementos desse nó dentro de uma Lista e a imprimo está vazia.

Meu XPathExpression até agora éexpr = xpath.compile("//td[@width='55']/font/div/text()"); (ou largura = '69 ', para o outro nó).

Minha tentativa de código completo é:

String cod = "IIND2401";
    String dep = cod.substring(0, 4);
    System.out.println(dep);
    try {
        URL url = new URL("http://registroapps.uniandes.edu.co/scripts/adm_con_horario1_joomla.php?depto="+dep);
        Tidy tidy = new Tidy();
        tidy.setXHTML(true);    
        Document doc = tidy.parseDOM(url.openStream(), System.out);

        // Use XPath to obtain whatever you want from the (X)HTML
        XPath xpath = XPathFactory.newInstance().newXPath();
        XPathExpression expr = xpath.compile("//td[@width='39']/font/text()");
        NodeList crn = (NodeList)expr.evaluate(doc, XPathConstants.NODESET);

Então pego os códigos que obtenho, os coloco em uma Lista e os imprimo:

List<String> crns = new ArrayList<String>();
        for (int i = 0; i < crn.getLength(); i++) {
            crns.add(crn.item(i).getNodeValue()); 
        }

System.out.println ("CRNs:"); System.out.println (crns);

O resultado é uma longa lista de identificações de cursos na minha universidade para o corpo docente do IIND. CRNs: [10110, 16886, 12420, 12526, 12527, 12528, 13510, 15146, 12544, 12545, (...)] Não consigo alterar o documento HTML, estou tentando analisá-lo no site da minha universidade . Algum conselho? Obrigado rapazes.

questionAnswers(0)

yourAnswerToTheQuestion