<tr> 
    <td bgcolor="#eaeaea" style="text-align:right" width=17% nowrap="true">产品名称</td> 
    <td bgcolor="#eaeaea" width=83%>大德康元牌人参粉</td></tr> 
           
<tr> 
    <td bgcolor="#ffffff" style="text-align:right" width=17% nowrap="true">注销原因</td> 
    <td bgcolor="#ffffff" width=83%></td></tr> 
 
<tr> 
    <td bgcolor="#eaeaea" style="text-align:right" width=17% nowrap="true">申请人中文名称</td> 
    <td bgcolor="#eaeaea" width=83%>正益(福建)保健品有限公司</td></tr> 
           
<tr> 
    <td bgcolor="#ffffff" style="text-align:right" width=17% nowrap="true">申请人地址</td> 
    <td bgcolor="#ffffff" width=83%>福建省石狮市玉池北路72-74号</td></tr> 
 
//看上面多行内容,如何把
1 把 “产品名称”的“大德康元牌人参粉”取出来,“大德康元牌人参粉”这个内容是变化的
2 同理,把“申请人中文名称”的“正益(福建)保健品有限公司”取出来,“正益(福建)保健品有限公司”这个内容也是变化的3 注意,“产品名称”或者“申请人中文名称”可能是为空 那么遇到了空的情况,就是判断为空请用JS字符匹配的方式,提取出关键字

解决方案 »

  1.   

    你好像发错版了。,,这是Java版
      

  2.   

    看看是这么回事么。<body>
    <table>
    <tr> 
        <td bgcolor="#eaeaea" style="text-align:right" width=17% nowrap="true">产品名称</td> 
        <td bgcolor="#eaeaea" width=83%>大德康元牌人参粉</td></tr> 
               
    <tr> 
        <td bgcolor="#ffffff" style="text-align:right" width=17% nowrap="true">注销原因</td> 
        <td bgcolor="#ffffff" width=83%></td></tr> 
     
    <tr> 
        <td bgcolor="#eaeaea" style="text-align:right" width=17% nowrap="true">申请人中文名称</td> 
        <td bgcolor="#eaeaea" width=83%>正益(福建)保健品有限公司</td></tr>   
               
    <tr> 
        <td bgcolor="#ffffff" style="text-align:right" width=17% nowrap="true">申请人地址</td> 
        <td bgcolor="#ffffff" width=83%>福建省石狮市玉池北路72-74号</td></tr> 
    <table>
    </body><script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
    <script type="text/javascript">
    $(function(){
    var proName = $("td:contains('产品名称')").next().html(); //产品名称
    var applicant = $("td:contains('申请人中文名称')").next().html(); //申请人中文名称

    if(proName==null || ""== proName)
    proName = "空"; if(applicant==null || ""== applicant)
    applicant = "空";   alert("产品名称:" + proName + "\n\n申请人中文名称:" + applicant);
    });</script>
      

  3.   

    真心不用了 。 要是以后有问题 可以问我邮箱 [email protected] , 不早了,睡觉吧。