Groovy 查找不带'的标签名称;不能立即从表中包含输入

Groovy 查找不带'的标签名称;不能立即从表中包含输入,groovy,Groovy,我有一个包含多个td/tr的表。 我的问题是我想要得到的标签并没有立即包含输入,也并没有任何属性 我想得到“永久居住国”和日期,它们在span中,但没有span在div中的任何属性,也不包含任何属性 我试过了 formElement[input[name="icims_gh_Permanent_Country_Residence"]] 但我不知道如何获得员工标签 Html看起来像: <div style="margin:0px"> <

我有一个包含多个td/tr的表。 我的问题是我想要得到的标签并没有立即包含输入,也并没有任何属性

我想得到“永久居住国”和日期,它们在span中,但没有span在div中的任何属性,也不包含任何属性

我试过了

formElement[input[name="icims_gh_Permanent_Country_Residence"]]
但我不知道如何获得员工标签

Html看起来像:

         <div style="margin:0px">
            <table style="width:100%" border="1" cellspacing="2" cellpadding="2">
              <tbody>
              <tr>
                <td valign="top">
                  <div style="margin:0px">
                    <span style="font-family:arial,helvetica,sans-serif;font-size:12px"> Countries of Permanent Residence (list all) </span>
                  </div>
                </td>
                <td valign="top">
                  <div style="margin:0px">
                    <span style="font-family:arial,helvetica,sans-serif;font-size:12px"> Dates </span>
                  </div>
                </td>
              </tr>
              <tr>
                <td colspan="2" valign="top">
                  <div style="margin:0px">
                    <div>
                      <input type="hidden" name="icims_gh_Permanent_Country_Residence" value="1">
                      <a name="0.1_icims_ga_Permanent_Country_Residence"></a>
                      <div>
                        <table style="width:100%;border:0px">
                          <tbody>
                          <tr>
                            <td>
                              <table style="width:100%" border="1" cellspacing="2" cellpadding="2">
                                <tbody>
                                <tr>
                                  <td valign="top">
                                    <div style="margin:0px">
                                      <span style="font-family:arial,helvetica,sans-serif;font-size:12px">
                                        <input type="text" name="icims_0_permResidenceCountry"> </span>
                                    </div>
                                  </td>
                                  <td valign="top">
                                    <div style="margin:0px">
                                      <span style="font-family:arial,helvetica,sans-serif;font-size:12px">
                                        <input type="text" name="icims_0_permResidenceCountryDates"> </span>
                                    </div>
                                  </td>
                                </tr>
                                </tbody>
                              </table>
                            </td>
                          </tr>
                          </tbody>
                        </table>
                      </div>

永久居住国(列出所有国家)
日期

请您解释一下,您试图通过什么方式阅读该html?这是一台xmlslurper吗?添加一个完整的工作示例。我正在使用jsoup提取器来提取html。例如:我们有一个类似于dishorable的html内容假设如果我想提取dishorable,那么我将像formElement[option[title=“dishorable”]]一样编写。请您解释一下,您试图通过什么方式阅读该html?这是一台xmlslurper吗?添加一个完整的工作示例。我正在使用jsoup提取器来提取html。例如:我们有一个类似于dishorable的html内容假设如果我想提取dishorable,那么我将像formElement[option[title=“dishorable”]一样编写。