Html test
<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title></title> </head> <body> <div id="list" style="margin-top:15px; display:none;"> <table class="table table-bordered table-striped"> <thead> <tr> <th>IP</th> <th>PORT</th> <th>匿名度</th> <th>类型</th> <th>位置</th> <th>响应速度</th> <th>最后验证时间</th> </tr> </thead> <tbody> <tr> <td>62.56.163.50</td> <td>53281</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_英国</td> <td>8秒</td> <td>2019/2/14 16:46:06</td> </tr> <tr> <td>109.72.236.119</td> <td>53281</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_俄罗斯</td> <td>2秒</td> <td>2019/2/14 16:15:06</td> </tr> <tr> <td>190.75.123.41</td> <td>8080</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_委内瑞拉</td> <td>5秒</td> <td>2019/2/14 15:44:10</td> </tr> <tr> <td>190.75.123.41</td> <td>8080</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_委内瑞拉</td> <td>7秒</td> <td>2019/2/14 15:44:09</td> </tr> <tr> <td>110.74.216.52</td> <td>55162</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_柬埔寨</td> <td>0秒</td> <td>2019/2/14 15:13:33</td> </tr> <tr> <td>177.87.40.158</td> <td>50351</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_巴西</td> <td>5秒</td> <td>2019/2/14 15:13:32</td> </tr> <tr> <td>189.126.76.95</td> <td>33511</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>巴西</td> <td>9秒</td> <td>2019/2/14 14:42:12</td> </tr> <tr> <td>159.203.153.71</td> <td>80</td> <td>高匿代理IP</td> <td>HTTP</td> <td>美国</td> <td>9秒</td> <td>2019/2/14 14:11:18</td> </tr> <tr> <td>117.242.37.85</td> <td>54933</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>印度</td> <td>6秒</td> <td>2019/2/14 13:40:14</td> </tr> <tr> <td>177.87.42.146</td> <td>37899</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_巴西</td> <td>2秒</td> <td>2019/2/14 13:09:08</td> </tr> <tr> <td>93.170.113.155</td> <td>53281</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>捷克</td> <td>6秒</td> <td>2019/2/14 12:38:05</td> </tr> <tr> <td>220.245.127.40</td> <td>8080</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>澳大利亚</td> <td>1秒</td> <td>2019/2/14 12:07:20</td> </tr> <tr> <td>43.229.227.104</td> <td>35201</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_日本</td> <td>9秒</td> <td>2019/2/14 11:36:53</td> </tr> <tr> <td>5.202.44.32</td> <td>8080</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_伊朗</td> <td>10秒</td> <td>2019/2/14 11:05:26</td> </tr> <tr> <td>5.202.44.32</td> <td>8080</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_伊朗</td> <td>10秒</td> <td>2019/2/14 11:05:26</td> </tr> </tbody> </table> </div> <div id="div1"> </div> <script> //输出格式为 46.36.112.93:8000@HTTP#伊朗 var t = document.getElementById("list").getElementsByTagName("table"); var table = t[0]; var tt = table.rows; var tt1 = tt[0].cells; var div1 = document.getElementById("div1"); for (var i = 1; i < table.rows.length; i++) { //循环传递过来的对象的行 第0行不传递 var span = document.createElement("div"); span.innerText = getcells(table.rows[i]); //设置行可以编辑 div1.appendChild(span); } function getcells(row) { for (var j = 0; j < row.cells.length; j++) { //循环传递过来的对象的单元格 var t = row.cells[j].innerHTML; var tt = row.cells[j].innerHTML + ":" + row.cells[j + 1].innerHTML + "@" + row.cells[j + 3].innerHTML + "#" + row.cells[j + 4].innerHTML; return tt; } } </script> </body> </html>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"><head> <meta charset="utf-8" /> <title></title></head><body> <div id="list" style="margin-top:15px; display:none;"> <table class="table table-bordered table-striped"> <thead> <tr> <th>IP</th> <th>PORT</th> <th>匿名度</th> <th>类型</th> <th>位置</th> <th>响应速度</th> <th>最后验证时间</th> </tr> </thead> <tbody> <tr> <td>62.56.163.50</td> <td>53281</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_英国</td> <td>8秒</td> <td>2019/2/14 16:46:06</td> </tr>
<tr> <td>109.72.236.119</td> <td>53281</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_俄罗斯</td> <td>2秒</td> <td>2019/2/14 16:15:06</td> </tr>
<tr> <td>190.75.123.41</td> <td>8080</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_委内瑞拉</td> <td>5秒</td> <td>2019/2/14 15:44:10</td> </tr>
<tr> <td>190.75.123.41</td> <td>8080</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_委内瑞拉</td> <td>7秒</td> <td>2019/2/14 15:44:09</td> </tr>
<tr> <td>110.74.216.52</td> <td>55162</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_柬埔寨</td> <td>0秒</td> <td>2019/2/14 15:13:33</td> </tr>
<tr> <td>177.87.40.158</td> <td>50351</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_巴西</td> <td>5秒</td> <td>2019/2/14 15:13:32</td> </tr>
<tr> <td>189.126.76.95</td> <td>33511</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>巴西</td> <td>9秒</td> <td>2019/2/14 14:42:12</td> </tr>
<tr> <td>159.203.153.71</td> <td>80</td> <td>高匿代理IP</td> <td>HTTP</td> <td>美国</td> <td>9秒</td> <td>2019/2/14 14:11:18</td> </tr>
<tr> <td>117.242.37.85</td> <td>54933</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>印度</td> <td>6秒</td> <td>2019/2/14 13:40:14</td> </tr>
<tr> <td>177.87.42.146</td> <td>37899</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_巴西</td> <td>2秒</td> <td>2019/2/14 13:09:08</td> </tr>
<tr> <td>93.170.113.155</td> <td>53281</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>捷克</td> <td>6秒</td> <td>2019/2/14 12:38:05</td> </tr>
<tr> <td>220.245.127.40</td> <td>8080</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>澳大利亚</td> <td>1秒</td> <td>2019/2/14 12:07:20</td> </tr>
<tr> <td>43.229.227.104</td> <td>35201</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_日本</td> <td>9秒</td> <td>2019/2/14 11:36:53</td> </tr>
<tr> <td>5.202.44.32</td> <td>8080</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_伊朗</td> <td>10秒</td> <td>2019/2/14 11:05:26</td> </tr>
<tr> <td>5.202.44.32</td> <td>8080</td> <td>高匿代理IP</td> <td>HTTPS</td> <td>SSL高匿_伊朗</td> <td>10秒</td> <td>2019/2/14 11:05:26</td> </tr>
</tbody> </table>
</div> <div id="div1">
</div> <script> //输出格式为 46.36.112.93:8000@HTTP#伊朗 var t = document.getElementById("list").getElementsByTagName("table"); var table = t[0]; var tt = table.rows; var tt1 = tt[0].cells; var div1 = document.getElementById("div1"); for (var i = 1; i < table.rows.length; i++) { //循环传递过来的对象的行 第0行不传递 var span = document.createElement("div"); span.innerText = getcells(table.rows[i]); //设置行可以编辑 div1.appendChild(span); }
function getcells(row) { for (var j = 0; j < row.cells.length; j++) { //循环传递过来的对象的单元格 var t = row.cells[j].innerHTML; var tt = row.cells[j].innerHTML + ":" + row.cells[j + 1].innerHTML + "@" + row.cells[j + 3].innerHTML + "#" + row.cells[j + 4].innerHTML; return tt; } } </script></body></html>