Spaces:
Running
Running
<html lang="zh-CN"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Playwright 代理服务使用说明</title> | |
<style> | |
body { | |
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; | |
line-height: 1.6; | |
max-width: 800px; | |
margin: 0 auto; | |
padding: 20px; | |
} | |
pre { | |
background-color: #f5f5f5; | |
padding: 15px; | |
border-radius: 5px; | |
overflow-x: auto; | |
} | |
code { | |
font-family: 'Courier New', Courier, monospace; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Playwright 代理服务</h1> | |
<h2>简介</h2> | |
<p>这是一个基于 Playwright 的代理服务,可以帮助你访问需要浏览器环境的网页。它使用真实的 Chromium 浏览器来渲染页面,支持 JavaScript 执行。</p> | |
<h2>使用方法</h2> | |
<h3>基本用法</h3> | |
<p>通过在 URL 参数中指定目标网址来使用代理服务:</p> | |
<pre><code>http://localhost:7860/?url=https://example.com</code></pre> | |
<h3>支持的 HTTP 方法</h3> | |
<ul> | |
<li>GET - 获取页面内容</li> | |
<li>POST - 发送表单数据或 JSON</li> | |
<li>PUT - 更新资源</li> | |
<li>DELETE - 删除资源</li> | |
<li>其他标准 HTTP 方法</li> | |
</ul> | |
<h3>示例</h3> | |
<p>1. 使用 curl 发送 GET 请求:</p> | |
<pre><code>curl "http://localhost:7860/?url=https://example.com"</code></pre> | |
<p>2. 发送 POST 请求:</p> | |
<pre><code>curl -X POST "http://localhost:7860/?url=https://example.com/api" \ | |
-H "Content-Type: application/json" \ | |
-d '{"key": "value"}'</code></pre> | |
<h2>注意事项</h2> | |
<ul> | |
<li>所有请求都会通过真实的浏览器执行,包括 JavaScript</li> | |
<li>服务会保持原始响应的状态码和大部分响应头</li> | |
<li>为了性能考虑,每个请求的超时时间默认为 30 秒</li> | |
</ul> | |
</body> | |
</html> |