(WebInfo wi,String domain)
| 111 | |
| 112 | //使用curl获取服务器信息,输入url |
| 113 | public static void getServerInfo(WebInfo wi,String domain) throws IOException { |
| 114 | String charset = "utf-8"; |
| 115 | charset = getCharset(domain); |
| 116 | //System.out.println("charset:"+charset); |
| 117 | if(!matcherChar(charset,"gb")){ |
| 118 | charset = "utf-8"; |
| 119 | } |
| 120 | //-L 跟随跳转 -i 打印详细信息 |
| 121 | String[] cmds = {"curl","-A","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36","-L","-i",domain}; |
| 122 | String result_html = execCurl(cmds,charset); |
| 123 | //获取的header和html信息 |
| 124 | //System.out.println(result_html); |
| 125 | if(!result_html.isEmpty()){ |
| 126 | wi.title = getTitle(result_html); |
| 127 | }else{ |
| 128 | System.out.println("无法获取域名的html"); |
| 129 | } |
| 130 | strName(wi,result_html); |
| 131 | LanguageCheck(wi); |
| 132 | NormalLanguageTest(wi); |
| 133 | ExceptionCheck(wi); |
| 134 | // CheckStatus(wi); |
| 135 | |
| 136 | } |
| 137 | |
| 138 | |
| 139 |
no test coverage detected