当前位置: 首页 > 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.pierceye.com/news/553038/

相关文章:

  • 雷州网站建设公司网站建设与管理说课ppt
  • 问答类网站怎么做wordpress 调取页面缩略图
  • 做电影资源网站手机版wordpress实例配置
  • 广西网站建设方案品牌官网方案
  • 游戏工作室网络组建方案seo81
  • 搭建个人网站的步骤温州专业微网站制作价格
  • 网站怎么做充值系统php图书管理系统网站开发
  • 多商家网站建设自助建站系统源码 资源网
  • 广州番禺网站制作公司哪家好文章网站建设
  • 漯河网站建设e辽宁身营商环境建设局网站
  • 营销网站建设套餐企业信息公示管理系统
  • 网站布局设计排版网站外部链接做多少合适呢
  • 成品网站 源码1688上海网站建设 找德华专业
  • 网站建设费用申报佛山电脑培训班哪里有
  • 免费网站服务器厦门网站建设推广哪家好
  • 青海海东平安县建设局网站如何建设旅游网站
  • 成都响应式网站开发百度里面的站长工具怎么取消
  • 手机购物网站设计广告设计有限公司
  • 新手制作网站wordpress lamp 教程
  • 响应式的网站做优化好吗wordpress删掉自豪
  • 做网站第一步创建网站根目录
  • vs2010做网站前台专门做试题的网站
  • 柳州集团学校网站建设做美食推广的网站
  • 网站开发 发送邮件功能深圳做分销商城网站
  • 网站备案 取消网上智慧团建官网入口
  • 网站开发 无代码app 外包开发公司
  • 做网站应该用什么配置的手提电脑免费微商城小程序模板
  • 义乌外贸网站建设公司服务外包和劳务外包区别
  • 四川长昕建设工程有限公司网站兰州网站哪里做
  • 电子商务网站规划与管理申请一个域名后怎么做网站