package com.fahaicc.lq;
import java.io.IOException;
import java.text.MessageFormat;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import com.fahaicc.tools.GetHtml;
public class F5604l1 {
public static void main(String[] args) throws IOException {
runAll();
}
public static void runAll() throws IOException {
String urString="http://www.bjztb.gov.cn/was5/web/search?page={0}&channelid=275208&searchword=%25+and+DOCCHANNEL%3D2098&keyword=%25+and+DOCCHANNEL%3D2098&StringEncoding=GBK&perpage=20&outlinepage=10&docChnlId=2098&docChnlname=%E6%8B%9B%E6%A0%87%E5%85%AC%E5%91%8A&needdecode=1";
for(int x=1;x<3184;x++)
{
Document document=GetHtml.getHtml(MessageFormat.format(urString, x), 10000);
Elements elements=document.getElementsByTag("a");
for (Element element : elements) {
System.out.println(element.html());
System.out.println(element.attr("href"));
}
String htmlString=document.html();
System.out.println(document.html());
System.out.println();
}
}
public static void update() {
}
public static void track() {
}
}
我说的注释是每行都有的那种文档说明 说明每行代码意思的那种
我是菜鸟 谁能帮我把这段代码全部都加上注释 谢谢
答案:2 悬赏:80 手机版
解决时间 2021-02-19 08:46
- 提问者网友:情歌越听越心酸
- 2021-02-18 15:15
最佳答案
- 五星知识达人网友:人间朝暮
- 2021-02-18 15:52
ctrl+a 然后 右ctrl+/
全部回答
- 1楼网友:神也偏爱
- 2021-02-18 17:17
<% const maxperpage=5 '设置一个静态变量 '定义变量 dim totalput dim currentpage dim totalpages dim i,j dim idlist '接受page 页数 if not isempty(request("page")) then currentpage=cint(request("page")) else currentpage=1 end if if not isempty(request("selannounce")) then idlist=request("selannounce") if instr(idlist,",")>0 then '返回idlist是否有"," dim idarr '定义变量 idarr=split(idlist) '以空格为分隔符,返回数组idarr dim id for i = 0 to ubound(idarr) id=clng(idarr(i)) '将数字转换成long格式的数字类型 call deleteannounce(id) '调用函数deleteannounce next else call deleteannounce(clng(idlist)) '调用函数deleteannounce end if end if dim sql dim rs set rs= server.createobject("adodb.recordset") sql="select * from orders where idtype='0' order by id" rs.open sql,conn,1,1 if rs.eof and rs.bof then response.write "
暂无信息
" else totalput=rs.recordcount '读取数据条数 if currentpage<1 then currentpage=1 end if if (currentpage-1)*maxperpage>totalput then if (totalput mod maxperpage)=0 then currentpage= totalput \ maxperpage else currentpage= totalput \ maxperpage + 1 end if end if if currentpage=1 then showpage totalput,maxperpage,"orders.asp" showcontent showpage totalput,maxperpage,"orders.asp" else if (currentpage-1)*maxperpage我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯