遍历网站的所有Url

news/2024/5/10 2:44:20/文章来源:https://blog.csdn.net/iteye_12007/article/details/81966970

网站的url分为很多种类:<a href="" />; <form action="" method="Get"/>;<link href=""/>;<img src=""/>;<script src=""/> ;<frame src=""/> 等等

难点:
递归遍历
获得页面每个url
同时请求(每种类型的请求方式都不同)
有些链接是重复的,需要去重

使用 Htmlparse 工具 下载htmlparser.jar
遍历 + 通过htmlparser 解析页面元素
Java代码 复制代码
  1. public class Urll {   
  2.   
  3.     // 定义的全局变量   
  4.     public static Vector<String> svecOutUrl = new Vector<String>();   
  5.     public static Vector<String> svecBadUrl = new Vector<String>();   
  6.     public static Vector<String> svecAUrl = new Vector<String>();   
  7.     public static final int DEEP=3//遍历的深度   
  8.     public static boolean bl; //判断标志   
  9.     private static String loc;   
  10.     private static Parser parser; //对超文本进行分析   
  11.        
  12.   
  13.     private static String hostName = "sina.com";   
  14.        
  15.        
  16.        
  17.        
  18.        
  19.     // 由于网站中URL之间的连接构成了图,所以对图的遍历这里采用深度优先的方法。   
  20.     public static void extractLinks(String loc) throws Exception {   
  21.   
  22.         String str1;   
  23.         URL wwwurl;   
  24.         boolean byes;   
  25.            
  26.         Vector<String> vecUrl=new Vector<String>();   
  27.            
  28.         // 解析 <a>   
  29.         try {   
  30.             parser = new Parser(loc); //原理见HTMLParser   
  31.             bl=true;   
  32.         }   
  33.         catch (Exception e) {   
  34.             bl=false;   
  35.             e.printStackTrace();   
  36.         }   
  37.            
  38.         filterStr = "a";   
  39.         filter = new TagNameFilter(filterStr);   
  40.         links = parser.extractAllNodesThatMatch(filter);    
  41.         for (int i = 0;i < links.size();i++) {   
  42.             if(bl)   
  43.             {   
  44.                 byes=true;   
  45.                 LinkTag LinkTag = (LinkTag)links.elementAt(i);   
  46.                 str1= LinkTag.getLink();   
  47.                 System.out.println(""+i);   
  48.                                 str1 = Patter (str1)   
  49.                 if(str1.equals("")) continue;   
  50.                 if(!svecAUrl.contains(str1))   
  51.                 {   
  52.                     try  
  53.                     {   
  54.                         // 判断是否可连接   
  55.                         wwwurl=new URL(str1);   
  56.                         URLConnection con = wwwurl.openConnection();   
  57.                         con.setConnectTimeout(1000);   
  58.                         con.getInputStream();   
  59.                     }   
  60.                     catch(SocketTimeoutException e)   
  61.                     {   
  62.                         byes=false;   
  63.                         svecBadUrl.add(str1);   
  64.                         continue;   
  65.                     }   
  66.                     catch(Exception e)   
  67.                     {   
  68.                         byes=false;   
  69.                         continue;   
  70.                     }   
  71.                     if(GetHostName(str1).equals(hostName))   
  72.                     {   
  73.                         svecAUrl.add(str1);   
  74.                         vecUrl.add(str1);   
  75.                     }   
  76.                     else  
  77.                     {   
  78.                         svecOutUrl.add(str1);   
  79.                     }   
  80.                 }   
  81.             }   
  82.         }   
  83.        
  84.            
  85.            
  86.         //  递归调用   
  87.         String strNew;   
  88.         int b = 1;   
  89.         if(b<=DEEP)   
  90.         {   
  91.   
  92.             for(int i=0;i<vecUrl.size();i++)   
  93.             {   
  94.                 strNew=(String)vecUrl.get(i);   
  95.                 extractLinks(strNew);    
  96.             }   
  97.         }   
  98.   
  99.     }   
  100.            
  101.        
  102.     // 通过该函数来判断所得URL是否是本网站的URL   
  103.     public static String GetHostName(String host)   
  104.     {   
  105.         URL aurl;   
  106.         String ss=" ";   
  107.         try  
  108.         {   
  109.             aurl=new URL(host);   
  110.             ss=aurl.getHost();   
  111.             ss = ss.substring(ss.length()-10, ss.length());   
  112.         }   
  113.         catch(Exception e)   
  114.         {   
  115.             e.printStackTrace();   
  116.         }   
  117.         return ss;   
  118.     }   
  119.        
  120. }     
public class Urll {// 定义的全局变量public static Vector<String> svecOutUrl = new Vector<String>();public static Vector<String> svecBadUrl = new Vector<String>();public static Vector<String> svecAUrl = new Vector<String>();public static final int DEEP=3; //遍历的深度public static boolean bl; //判断标志private static String loc;private static Parser parser; //对超文本进行分析private static String hostName = "sina.com";// 由于网站中URL之间的连接构成了图,所以对图的遍历这里采用深度优先的方法。public static void extractLinks(String loc) throws Exception {String str1;URL wwwurl;boolean byes;Vector<String> vecUrl=new Vector<String>();// 解析 <a>try {parser = new Parser(loc); //原理见HTMLParserbl=true;}catch (Exception e) {bl=false;e.printStackTrace();}filterStr = "a";filter = new TagNameFilter(filterStr);links = parser.extractAllNodesThatMatch(filter); for (int i = 0;i < links.size();i++) {if(bl){byes=true;LinkTag LinkTag = (LinkTag)links.elementAt(i);str1= LinkTag.getLink();System.out.println(""+i);str1 = Patter (str1)if(str1.equals("")) continue;if(!svecAUrl.contains(str1)){try{// 判断是否可连接wwwurl=new URL(str1);URLConnection con = wwwurl.openConnection();con.setConnectTimeout(1000);con.getInputStream();}catch(SocketTimeoutException e){byes=false;svecBadUrl.add(str1);continue;}catch(Exception e){byes=false;continue;}if(GetHostName(str1).equals(hostName)){svecAUrl.add(str1);vecUrl.add(str1);}else{svecOutUrl.add(str1);}}}}//	递归调用String strNew;int b = 1;if(b<=DEEP){for(int i=0;i<vecUrl.size();i++){strNew=(String)vecUrl.get(i);extractLinks(strNew); }}}// 通过该函数来判断所得URL是否是本网站的URLpublic static String GetHostName(String host){URL aurl;String ss=" ";try{aurl=new URL(host);ss=aurl.getHost();ss = ss.substring(ss.length()-10, ss.length());}catch(Exception e){e.printStackTrace();}return ss;}}	


去重需要使用正则表达式
Java代码 复制代码
  1. private String Patter (String str) {   
  2.        
  3.     if (str.indexOf("http:") == -1) {   
  4.         return str = "";   
  5.     }   
  6.   
  7.     Pattern p = Pattern.compile("http://www.sina.com/\\d+/v/\\d+.html");   
  8.     Matcher  m = p.matcher(str);   
  9.     boolean  b = m.matches();   
  10.     if (b) {   
  11.         str = "http://www.sina.com/0/v/0.html";   
  12.         return str;   
  13.     }   
	private String Patter (String str) {if (str.indexOf("http:") == -1) {return str = "";}Pattern	p = Pattern.compile("http://www.sina.com/\\d+/v/\\d+.html");Matcher  m = p.matcher(str);boolean  b = m.matches();if (b) {str = "http://www.sina.com/0/v/0.html";return str;}
}


二、用htmlparse 可以对 a ,link,script,img 元素获取,但无法解决对form的递归提交,因为form提交方式分为get,post两种,对post方式参数列表无法获取,无法动态设置post提交方式。
使用HttpUnit测试工具很好强大的模拟浏览器,可以任意提交,页面元素也可以获得。
下载引入 httpunit.rar
Java代码 复制代码
  1.        
  2.     private static WebConversation wc = new WebConversation();     
  3.     private static WebForm w;   
  4.   
  5. // 由于网站中URL之间的连接构成了图,所以对图的遍历这里采用深度优先的方法。   
  6.     public static void extractLinks(WebRequestSource webT,String method,boolean start) throws Exception {   
  7.   
  8.         Vector<WebForm> vecForm=new Vector<WebForm>();   
  9.         Vector<WebLink> vecLink=new Vector<WebLink>();   
  10.         WebResponse resp = null;   
  11.         WebForm[] webForm = new WebForm[0];   
  12.         WebLink[] webLink = new WebLink[0];   
  13.         try {   
  14.             HttpUnitOptions.setExceptionsThrownOnScriptError(false);   
  15.             // 按照 Get Post link 类型打开web   
  16.   
  17.             if (start) {   
  18.                 // 首页   
  19.                 WebRequest req = new PostMethodWebRequest("http://www.sina.com/");   
  20.                 resp = wc.getResponse(req);   
  21.             } else if ("post".equals(method) || "get".equals(method)) {   
  22.                                //获得form 并提交   
  23.                 WebForm w = (WebForm) webT;   
  24.                 [color=red]resp = w.submit();[/color]   
  25.             } else {   
  26.                 WebLink l = (WebLink) webT;   
  27.                 [color=red]resp = l.click();[/color]   
  28.             }   
  29.             webForm = resp.getForms();   
  30.             webLink = resp.getLinks();   
  31.   
  32.             bl=true;   
  33.         } catch (Exception e) {   
  34.             bl=false;   
  35.             e.printStackTrace();   
  36.         }   
  37.   
  38.         String ss,str1;   
  39.         URL wwwurl;   
  40.         boolean byes;   
  41.         StringBuffer strUrl;   
  42.         int a=0,b=0,tID=0;   
  43.         b++;   
  44.            
  45.            
  46.            
  47.            
  48.         // 获取一个页面中所有的FORM中URL   
  49.         for (int i = 0;i < webForm.length;i++) {   
  50.             if(bl) {   
  51.                 byes=true;   
  52.                 // 按照 Get Post 类型    
  53.                 strUrl = new StringBuffer(resp.getURL().toString());   
  54.                    
  55.                 if (!"./".equals(webForm[i].getAction()) && "post".equals(webForm[i].getMethod())) {   
  56.                     strUrl.append(webForm[i].getAction().substring(1, webForm[i].getAction().length()));   
  57.                     strUrl.append("?");   
  58.                     String[] para = webForm[i].getParameterNames();   
  59.                     for (int p = 0;p< para.length;p++) {   
  60.                         strUrl.append(para[p]);   
  61.                         strUrl.append("=&");   
  62.                     }   
  63.                 } else if (!"./".equals(webForm[i].getAction())) {   
  64.                     strUrl.append(webForm[i].getAction().substring(1, webForm[i].getAction().length()));   
  65.                 }   
  66.                    
  67.                 if(strUrl.equals("")) continue;   
  68.   
  69.                 if(!svecLink.contains(strUrl.toString())) {   
  70.                     try {   
  71.                         // 按照 Get Post 类型    
  72.                         if (!"./".equals(webForm[i].getAction())) {   
  73.                             webForm[i].submit();   
  74.                         }   
  75.                     } catch(Exception e) {   
  76.                         byes=false;   
  77.                     }   
  78.                     if(GetHostName(strUrl.toString()).equals(hostName) && byes){   
  79.                         a++;   
  80.                         tID++;   
  81.                         svecLink.add(strUrl.toString());   
  82.                         // 按照 Get Post 类型    
  83.                         vecForm.add(webForm[i]);   
  84.                     } else {   
  85.                         svecOutlink.add(strUrl.toString());   
  86.                     }   
  87.                        
  88.                     if (svecLink.size() >= 1000) {   
  89.                         svecLink.clear();   
  90.                     }   
  91.                 }   
  92.             }   
  93.         }   
  94.            
  95.         // 获取一个页面中所有的LINK中URL   
  96.         for (int i = 0;i < webLink.length;i++) {   
  97.             if(bl) {   
  98.                 byes=true;   
  99.                 // 按照 Link 类型    
  100.                 strUrl = new StringBuffer(webLink[i].getURLString());   
  101.                    
  102.                 if (strUrl.indexOf("http") == -1) {   
  103.                     strUrl = new StringBuffer();   
  104.                 }   
  105.                 if(strUrl == null || "".equals(strUrl.toString())) continue;   
  106.   
  107.                 if(!svecLink.contains(strUrl.toString())) {   
  108.                     try {   
  109.                             webLink[i].newScriptable();   
  110.                             HttpUnitOptions.clearScriptErrorMessages();   
  111.                             HttpUnitOptions.setExceptionsThrownOnScriptError(false);   
  112.                             HttpUnitOptions.setScriptingEnabled(false);   
  113.                             HttpUnitOptions.setJavaScriptOptimizationLevel(0);   
  114.                             WebRequest re = webLink[i].getRequest();   
  115.                             URL u = re.getURL();   
  116.                             u.getContent();   
  117.                             // 按照 Link 类型    
  118.                     } catch(Exception e) {   
  119.                         byes=false;   
  120.                         System.out.print(e.getMessage());   
  121.                     }   
  122.                     if(GetHostName(strUrl.toString()).equals(hostName) && byes){   
  123.                         a++;   
  124.                         tID++;   
  125.                         svecLink.add(strUrl.toString());   
  126.                         // 按照 Link 类型    
  127.                         vecLink.add(webLink[i]);   
  128.                     } else {   
  129.                         svecOutlink.add(strUrl.toString());   
  130.                     }   
  131.                        
  132.                     if (svecLink.size() >= 1000) {   
  133.                         svecLink.clear();   
  134.                     }   
  135.                 }   
  136.             }   
  137.         }   
  138.   
  139.            
  140.         WebForm webFNew;   
  141.         WebLink webLNew;   
  142.         if(a>0&&b<=DEEP) {   
  143.   
  144.             //  递归调用   
  145.             for(int i=0,j=0;i<vecForm.size()||j<vecLink.size();i++,j++) {   
  146.                 webFNew = (WebForm)vecForm.get(i);   
  147.                 extractLinks(webFNew,webFNew.getMethod().toString(),false);    
  148.                    
  149.                 webLNew = (WebLink)vecLink.get(j);   
  150.                 extractLinks(webLNew,"link".toString(),false);    
  151.                    
  152.             }   
  153.         }   
  154.   
  155.     }   
  156.        
  157.        
  158.        
  159.        
  160.        
  161.     // 通过该函数来判断所得URL是否是本网站的URL,如果不是就不需要添加svecLink中如果是并且以前没有提取过就添加到svecLink中。   
  162.     public static String GetHostName(String host) {   
  163.         URL aurl;   
  164.         String ss=" ";   
  165.         try {   
  166.             aurl=new URL(host);   
  167.             ss=aurl.getHost();   
  168.             ss = ss.substring(ss.length()-10, ss.length());   
  169.         } catch(Exception e) {   
  170.             e.printStackTrace();   
  171.         }   
  172.         return ss;   
  173.     }   
  174.        
  175. }  
	private static WebConversation wc = new WebConversation();	private static WebForm w;// 由于网站中URL之间的连接构成了图,所以对图的遍历这里采用深度优先的方法。public static void extractLinks(WebRequestSource webT,String method,boolean start) throws Exception {Vector<WebForm> vecForm=new Vector<WebForm>();Vector<WebLink> vecLink=new Vector<WebLink>();WebResponse resp = null;WebForm[] webForm = new WebForm[0];WebLink[] webLink = new WebLink[0];try {HttpUnitOptions.setExceptionsThrownOnScriptError(false);// 按照 Get Post link 类型打开webif (start) {// 首页WebRequest req = new PostMethodWebRequest("http://www.sina.com/");resp = wc.getResponse(req);} else if ("post".equals(method) || "get".equals(method)) {//获得form 并提交WebForm w = (WebForm) webT;[color=red]resp = w.submit();[/color]} else {WebLink l = (WebLink) webT;[color=red]resp = l.click();[/color]}webForm = resp.getForms();webLink = resp.getLinks();bl=true;} catch (Exception e) {bl=false;e.printStackTrace();}String ss,str1;URL wwwurl;boolean byes;StringBuffer strUrl;int a=0,b=0,tID=0;b++;// 获取一个页面中所有的FORM中URLfor (int i = 0;i < webForm.length;i++) {if(bl) {byes=true;// 按照 Get Post 类型 strUrl = new StringBuffer(resp.getURL().toString());if (!"./".equals(webForm[i].getAction()) && "post".equals(webForm[i].getMethod())) {strUrl.append(webForm[i].getAction().substring(1, webForm[i].getAction().length()));strUrl.append("?");String[] para = webForm[i].getParameterNames();for (int p = 0;p< para.length;p++) {strUrl.append(para[p]);strUrl.append("=&");}} else if (!"./".equals(webForm[i].getAction())) {strUrl.append(webForm[i].getAction().substring(1, webForm[i].getAction().length()));}if(strUrl.equals("")) continue;if(!svecLink.contains(strUrl.toString())) {try {// 按照 Get Post 类型 if (!"./".equals(webForm[i].getAction())) {webForm[i].submit();}} catch(Exception e) {byes=false;}if(GetHostName(strUrl.toString()).equals(hostName) && byes){a++;tID++;svecLink.add(strUrl.toString());// 按照 Get Post 类型 vecForm.add(webForm[i]);} else {svecOutlink.add(strUrl.toString());}if (svecLink.size() >= 1000) {svecLink.clear();}}}}// 获取一个页面中所有的LINK中URLfor (int i = 0;i < webLink.length;i++) {if(bl) {byes=true;// 按照 Link 类型 strUrl = new StringBuffer(webLink[i].getURLString());if (strUrl.indexOf("http") == -1) {strUrl = new StringBuffer();}if(strUrl == null || "".equals(strUrl.toString())) continue;if(!svecLink.contains(strUrl.toString())) {try {webLink[i].newScriptable();HttpUnitOptions.clearScriptErrorMessages();HttpUnitOptions.setExceptionsThrownOnScriptError(false);HttpUnitOptions.setScriptingEnabled(false);HttpUnitOptions.setJavaScriptOptimizationLevel(0);WebRequest re = webLink[i].getRequest();URL u = re.getURL();u.getContent();// 按照 Link 类型 } catch(Exception e) {byes=false;System.out.print(e.getMessage());}if(GetHostName(strUrl.toString()).equals(hostName) && byes){a++;tID++;svecLink.add(strUrl.toString());// 按照 Link 类型 vecLink.add(webLink[i]);} else {svecOutlink.add(strUrl.toString());}if (svecLink.size() >= 1000) {svecLink.clear();}}}}WebForm webFNew;WebLink webLNew;if(a>0&&b<=DEEP) {//	递归调用for(int i=0,j=0;i<vecForm.size()||j<vecLink.size();i++,j++) {webFNew = (WebForm)vecForm.get(i);extractLinks(webFNew,webFNew.getMethod().toString(),false); webLNew = (WebLink)vecLink.get(j);extractLinks(webLNew,"link".toString(),false); }}}// 通过该函数来判断所得URL是否是本网站的URL,如果不是就不需要添加svecLink中如果是并且以前没有提取过就添加到svecLink中。public static String GetHostName(String host) {URL aurl;String ss=" ";try {aurl=new URL(host);ss=aurl.getHost();ss = ss.substring(ss.length()-10, ss.length());} catch(Exception e) {e.printStackTrace();}return ss;}}


对于不符合链接格式的都会无法请求 也就是坏链接。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_833509.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

网站的安全登录认证设计[z]

From: http://www.williamlong.info/archives/823.html 用户登录是任何一个应用系统的基本功能&#xff0c;特别是对于网上银行系统来说&#xff0c;用户登录的安全性尤为重要。如何设计一个网站的安全登录认证程序&#xff0c;是本文主要讨论的问题。 静态密码存在着比较多的安…

15个网站用户体验优化禁忌

From&#xff1a;http://www.blueidea.com/design/doc/2009/6587.asp 对于一个界定明确的用户群体来讲&#xff0c;其用户体验的共性是能够经由良好设计的实验来认识到。 用户体验&#xff0c;英文叫做User Experience&#xff0c;缩写为UE或者UX。一种纯主观的在用户访问一个…

网站的表单验证

html代码&#xff1a;<form id"register_form" name"register-form" action"###" method"post"><label><input id"phone" name"phone" placeholder"您的手机号" tipMsg"手机号不能…

协助用户搜寻您的网站 { 创建一个OpenSearch }

From: http://www.cnblogs.com/jaic-xiao/archive/2008/07/31/xie_zhu_yong_hu_sou_suo_nin_de_wang_zhan_chang_cao_yi_ge_opensearch.html 导言 现代浏览器其中一个最美好的特点&#xff0c; Microsoft Internet Explorer 和 Mozilla Firefox 的浏览器右上角有一个搜索…

大型网站架构演变和知识体系【z】

From&#xff1a;http://www.blogjava.net/BlueDavy/archive/2008/09/03/226749.html 之前也有一些介绍大型网站架构演变的文章&#xff0c;例如LiveJournal的、ebay的&#xff0c;都是非常值得参考的&#xff0c;不过感觉他们讲的更多的是每次演变的结果&#xff0c;而没有很详…

电子商务基础:中小企业建站方案和资源

From: http://www.williamlong.info/archives/2111.html 目前国内的中小企业数量已经有几千万家&#xff0c;但信息化建设却并不理想&#xff0c;拥有网站的只有不超过两百万家&#xff0c;数以千万计的中小企业存在电子商务需求&#xff0c;却没有自己独立的网站。现在&#x…

网站的MRD和PRD[z]

From: http://mearsen.blog.sohu.com/67881175.html 说到MRD&#xff0c;就不得不说一下PRD&#xff0c;也有朋友提到了这个问题&#xff0c;MRD和PRD有什么区别呢&#xff1f;如果大家看过中国产品经理联盟的第一期和第二期杂志&#xff0c;那么就应该知道MRD和PRD的区别和关系…

使用HttpWebRequest下载远程文件部分网站出现异常

今天使用HttpWebRequest方式编写了个从其它网站抓取资源的小工具。在测试过程中发现&#xff0c;有些网站会出现如下异常&#xff1a;服务器提交了协议冲突. SectionResponseHeader DetailCR 后面必须是 LF google一把找到不少相关资料&#xff0c;最终使用配置App.config方式…

给网站写一个JSON,并远程请求。

在使用json之前我们应该先了解一下什么是json&#xff1f; json全称JavaScript Object Notation&#xff0c;即js对象简谱&#xff0c; 是一种轻量级的数据交换格式。它基于 ECMAScript (欧洲计算机协会制定的js规范)的一个子集&#xff0c;采用完全独立于编程语言的文本格式来…

刷网站关键字_磐安县网站SEO外包,360优化,热门

首页 > 新闻中心发布时间&#xff1a;2020-11-18 16:36:37 导读&#xff1a;万推霸屏为您提供磐安县网站SEO外包,360优化的相关知识与详情&#xff1a; 我相信所有的优化朋友都知道&#xff0c;网站优化的目的是优化百度。做外链很多人都会采用大型和问答平台这两种方式&…

御用导航提示页面最新_seo页面怎么优化?seo页面优化有哪些方法?

seo页面怎么优化&#xff1f;seo页面优化有哪些方法&#xff1f;seo如何优化好页面以对搜索引擎友好?可实现的方式可多样化&#xff0c;效率较高的方式为找到优质网站的各类型页面模型优势&#xff0c;直接使用到自己的站点。假设某一个网站的首页关键词排名较好&#xff0c;某…

[搜索引擎研究和开发]纯手工编写操作I/O文件流的TAG网站标签系统(索引原理)...

本人喜欢钻研技术&#xff0c;两年前就已经对搜索引擎的海量数据检索兴趣甚浓&#xff0c;而.NET中的类库功能强大&#xff0c;非常方便于快速编写代码以实现自己的想法。对于全文检索引擎&#xff0c;如何能够令其在极短的时间内查找到用户所需要的数据&#xff0c;对应付大量…

初次尝试python爬虫,爬取小说网站的小说。

本次是小阿鹏&#xff0c;第一次通过python爬虫去爬一个小说网站的小说。 下面直接上菜。 1.首先我需要导入相应的包&#xff0c;这里我采用了第三方模块的架包&#xff0c;requests。requests是python实现的简单易用的HTTP库&#xff0c;使用起来比urllib简洁很多&#xff0c;…

外部样式表 div居中不起作用_网站DIV+CSS教程培训教程X(HTMLCSS基础知识)一

XHTML CSS基础知识1&#xff09;文档类型<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3。org/TR/xhtml1/DTD/xhtml1-transitional.dtd">一定要保留这句话&#xff0c;删除它后可能引起某些样式表失效或其它意想不…

html适应手机显示不全_制作手机网站的重要性

移动互联网和PC互联网互相存在的时代&#xff0c;手机网站对于企业来说也非常的重要&#xff0c;在pc互联网时代网站的结构都只适应电脑端浏览&#xff0c;一旦放在更小屏幕的手机端打开就会页面错乱&#xff0c;文字不清晰&#xff0c;图片显示不全等问题&#xff0c;严重营销…

中的nginx 修改_如何使网站支持https访问?nginx配置https证书

购买SSL证书要想使用https访问你的网址&#xff0c;首先得拥有颁发的SSL证书。我使用的是免费版&#xff0c;有效期为一年&#xff0c;过期后再重新申请。申请SSL证书购买后&#xff0c;可在搜索框输入证书关键字进入到控制台。点击证书申请&#xff0c;按照提示填写完相关信息…

如何搭建基于Java的网站服务器

租赁主机 租赁主机,去主机服务商那里租赁一台主机,可以去阿里云,腾讯云,狗爹,华为云那里租,也可以租其他的主机,还可以用花生壳自己在家里搭建一个,总之,你需要一台具有固定唯一公网IP的电脑; 软件装备软件准备,需要准备的软件列表如下:CentOS-7-x86_64-DVD-1611.iso,FileZilla…

学生问我25-30K得面试题能不能帮忙,这我不得上,爬取某网站电影视频内容

前言 嗨喽&#xff01;大家好&#xff0c;这里是魔王~ 一般国外的电影电视剧&#xff0c;咋都找不到资源&#xff0c;很多人就对此束手无策了 这个时候python就很有用了&#xff0c;只要叫得出名字的&#xff0c;都可以几行代码搞定~ [本次内容]: Python爬取美剧网站电影视…

使用python 采集某网站全站美女图片 ,这么好看得图还不学起来(含完整源码)

本次目的&#xff1a; python 抓取某某站图片 本次亮点&#xff1a; 系统性分析页面多页面数据解析海量图片数据保存 开发环境 & 第三方模块&#xff1a; 解释器版本 >>> python 3.8代码编辑器 >>> pycharm 2021.2requests >>> pip install…

Python实现下载全球最大旅游网站Tripadvisor美食数据~

前言 嗨喽&#xff01;大家好&#xff0c;这里是魔王~ Tripadvisor 是全球领先的旅游网站&#xff0c; 主要提供来自全球旅行者的点评和建议 全面覆盖全球的酒店、景点、餐厅、航空公司 &#xff0c;以及旅行规划和酒店、景点、餐厅预订功能。 Tripadvisor及旗下网站在全球49个…