当前位置: 首页 > news >正文

故乡网站开发的意义公司建网站多少

故乡网站开发的意义,公司建网站多少,网站开发技术留言,用易语言做攻击网站软件JSOUP指的是前端爬虫框架#xff0c;对HTML网页的一系列操作包括信息的获取内容的修改等。 jsoup简单应用 1.三种加载HTML的方法 Testpublic void test1() throws IOException {//从URL加载HTMLDocument document Jsoup.connect(http://www.guge.com).get();St…JSOUP指的是前端爬虫框架对HTML网页的一系列操作包括信息的获取内容的修改等。 jsoup简单应用 1.三种加载HTML的方法 Testpublic void test1() throws IOException {//从URL加载HTMLDocument document Jsoup.connect(http://www.guge.com).get();String title document.title();//获取html中的标题System.out.println(title :title);//从字符串加载HTMLString html htmlheadtitleFirst parse/title/head bodypParsed HTML into a doc./p/body/html;Document doc Jsoup.parse(html);title doc.title();System.out.println(title :title);//从文件加载HTMLdoc Jsoup.parse(new File(d:\\file\\html\\index.html),utf-8);title doc.title();System.out.println(title :title);}2.获取html中的headbody,url等信息 Testpublic void test2() throws IOException {Document document Jsoup.connect(http://www.guge.com).get();String title document.title();System.out.println(title :title);//获取html中的headSystem.out.println(document.head());//获取html中的body//System.out.println(document.body());//获取HTML页面中的所有链接Elements links document.select(a[href]);for (Element link : links){System.out.println(link : link.attr(href));System.out.println(text : link.text());}}3.获取URL的地址信息 Testpublic void test3() throws IOException {Document document Jsoup.connect(https://passport.lagou.com).get();System.out.println(document.head());//获取URL的元信息String description document.select(meta[namedescription]).get(0).attr(content);System.out.println(Meta description : description);String keywords document.select(meta[namekeywords]).first().attr(content);System.out.println(Meta keyword : keywords);}4.根据class名称获取表单 Testpublic void test4() throws IOException {Document document Jsoup.connect(https://passport.lagou.com/login/login.html?signature8ECBCDF2B86061432B425A0B94FC863Bservicehttps%253A%252F%252Fwww.lagou.com%252FactionloginserviceIdlagouts1547711303033).get();//获取拉勾网登入页面的body//System.out.println(document.body());//根据class名称获取表单Elements formElement document.getElementsByClass(form_body);System.out.println(formElement.html());//获取URL的元信息for (Element inputElement : formElement) {String placeholder inputElement.getElementsByTag(input).attr(placeholder);System.out.println(placeholder);}}5.提取并打印表单参数 Testpublic void test5() throws IOException {Document document Jsoup.parse(new File(d:\\file\\html\\index.html),utf-8);Element loginform document.getElementById(registerform);Elements inputElements loginform.getElementsByTag(input);for (Element inputElement : inputElements) {String key inputElement.attr(name);String value inputElement.attr(value);System.out.println(Param name: key -- Param value: value);}}6.设置元素的html内容 Testpublic void test6() throws IOException {Document document Jsoup.parse(new File(d:\\file\\html\\index.html),utf-8);System.out.println(document.body());// div iddiv1/divSystem.out.println(----------------);Element div document.select(div).first();div.html(pHello/p); // div iddiv1pHello/p/divdiv.prepend(pFiest/p); //div iddiv1pFiest/ppHello/p/divdiv.append(pLast/p); //div iddiv1pFiest/ppHello/ppLast/p/divSystem.out.println(document.body());System.out.println(------------------);System.out.println(div.text());System.out.println(-------------------);//对元素包裹一个外部HTML内容div.wrap(div id\div2\/div); //div iddiv2div iddiv1pFiest/ppHello/ppLast/p/divSystem.out.println(document.body());}7.设置元素的文本内容 Testpublic void test7() throws IOException {Document document Jsoup.parse(new File(d:\\file\\html\\index.html),utf-8);System.out.println(document.body());// div iddiv1/divSystem.out.println(-------------------);Element div document.select(div).first();div.text(7 8 ); // div iddiv17 gt; 8 /divdiv.prepend(Fiest ); //div iddiv1Fiest 7 gt; 8/divdiv.append(Last ); //div iddiv1Fiest 7 gt; 8 Last/divSystem.out.println(document.body());System.out.println(---------------);System.out.println(div.text());}了解更多关注我哟
http://www.sadfv.cn/news/339700/

相关文章:

  • 商城网站开发视频教程有域名和虚拟服务器后怎么做网站
  • 服务态度 专业的网站建设广州市恒嘉建设有限公司网站
  • 一个网站 两个数据库制作公司网站的步骤
  • 温州地区做网站网站做的二维码失效了
  • 四川住房建设和城乡建设厅假网站wordpress 作者推荐
  • 网站怎么做自营销英文网站接单做翻译
  • 网站备案加急南昌外包建站
  • 单位网站建设管理情况中国建筑公司排名一览表
  • 网站设计内容板块wordpress js插件
  • 请人做软件开发的网站设计师服务平台官网
  • 湖南网站设计网站建设160页答案
  • 网站开发seo呼市企业网站制作
  • 网站建设pc指什么柳州市住房和城乡建设局网站首页
  • 公司网站怎么做备案信息鹤壁专业做网站多少钱
  • 软件定制网站建设网站建设具备哪些技术人员
  • 海口建设网站建设wordpress更换主题时
  • 广州网站建设知名乐云seo大型的PC网站适合vue做吗
  • 教育教研网站建设的意义北京朝阳区地图高清版大图
  • 像网站的ppt怎么做wordpress 后台密码错误
  • 宜宾住房与城乡建设部网站福州市网站建设有限公司
  • 网站 建设 毕业设计 要求seo的主要工作是什么
  • 天津专业做网站的公司有哪些wordpress轮播图代码
  • 做网站运营江西省城乡住房建设部网站
  • 网页制作背景图洛阳seo培训
  • 财政网站 建设方案个人网站还用备案吗
  • 椒江哪里可以做公司网站图片模板制作app
  • 网站开发的平台有什么做网站好用的软件
  • 网站制作建站程序营销型网站的建设重点是什么
  • 知名网站建设制作沈阳建站模板源码
  • 专业电商网站建设龙岩kk人才网招聘