| 发表于:2007-07-12 10:23:30 楼主 |
我提取了网页的html代码,我需要body里的内容.我用了 str1 = str1.substring(str1.indexof(start_str) + 34, str1.indexof(end_str) -str1.indexof(start_str) - 34) 这样可以提取出body之间的内容,但是我不明白这样为什么会去掉body头和body尾. 为什么要加+34和-34,哪位达人帮忙解释一下好吗? 网页代码如下: <!doctype html public "-//w3c//dtd html 4.0 transitional//en "> <html> <head> <title> test1 </title> <meta content= "microsoft visual studio .net 7.1 " name= "generator "> <meta content= "visual basic .net 7.1 " name= "code_language "> <meta content= "javascript " name= "vs_defaultclientscript "> <meta content= "http://schemas.microsoft.com/intellisense/ie5 " name= "vs_targetschema "> </head> <body id= "bodyid " runat= "server " ms_positioning= "gridlayout "> <form id= "form1 " method= "post " runat= "server "> <asp:button id= "button1 " style= "z-index: 101; left: 312px; position: absolute; top: 160px " runat= "server " text= "button "> </asp:button> <asp:textbox id= "textbox1 " style= "z-index: 102; left: 240px; position: absolute; top: 200px " runat= "server " width= "184px " height= "24px "> </asp:textbox> </form> </body> </html> |
|
|
|
|