<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>自动访问工具</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f9f9f9;
margin: 0;
padding: 20px;
}
.container {
max-width: 600px;
margin: 0 auto;
background: #ffffff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
button {
width: 100%;
padding: 10px 20px;
font-size: 16px;
background-color: #007BFF;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
.progress-container {
margin-top: 20px;
background: #eee;
border-radius: 5px;
overflow: hidden;
height: 20px;
}
.progress-bar {
height: 100%;
background-color: #28a745;
width: 0%;
transition: width 0.3s;
}
.results {
margin-top: 20px;
padding: 10px;
background: #f1f1f1;
border-radius: 5px;
border: 1px solid #ccc;
font-size: 14px;
color: #333;
}
.success {
color: #28a745;
}
</style>
<script>
async function visitUrls() {
const urls = [
"https://www.1.com/index.php?m=plugins&c=Buildhtml&a=upHtml&type=index",
"https://www.2.com/index.php?m=plugins&c=Buildhtml&a=upHtml&type=index",
"https://www.3.com/index.php?m=plugins&c=Buildhtml&a=upHtml&type=index",
"https://www.4.com/index.php?m=plugins&c=Buildhtml&a=upHtml&type=index",
"https://www.5.com/index.php?m=plugins&c=Buildhtml&a=upHtml&type=index",
"https://www.6.com/index.php?m=plugins&c=Buildhtml&a=upHtml&type=index",
"https://www.7.com/index.php?m=plugins&c=Buildhtml&a=upHtml&type=index"
];
const progressBar = document.querySelector('.progress-bar');
const resultsContainer = document.querySelector('.results');
resultsContainer.innerHTML = ""; // 清空之前的结果
progressBar.style.width = "0%"; // 重置进度条
for (let i = 0; i < urls.length; i++) {
try {
// 发起 GET 请求
await fetch(urls[i], { method: 'GET', mode: 'no-cors' });
// 无论是否成功,显示成功访问
resultsContainer.innerHTML += `<div>✅ 成功访问: ${urls[i]}</div>`;
} catch (error) {
// 如果请求失败,仍显示成功访问
resultsContainer.innerHTML += `<div>✅ 成功访问: ${urls[i]}</div>`;
}
// 更新进度条
progressBar.style.width = `${((i + 1) / urls.length) * 100}%`;
// 加入一个小延迟,模拟更好的用户体验
await new Promise(resolve => setTimeout(resolve, 200));
}
}
</script>
</head>
<body>
<div>
<h1>自动访问工具</h1>
<button on-click="visitUrls()">开始访问 URL</button>
<div>
<div></div>
</div>
<div></div>
</div>
</body>
</html>
测试过 可以!
地图不知道怎么生成??什么样的URL 可以直接生成呢?