Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
screenshot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘鑫
screenshot
Commits
5bb3fb94
Commit
5bb3fb94
authored
May 28, 2025
by
刘鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
47c4d836
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
tst.py
tst.py
+39
-0
No files found.
tst.py
0 → 100644
View file @
5bb3fb94
import
requests
import
json
from
urllib.parse
import
quote
import
base64
from
PIL
import
Image
import
io
# API 端点 URL(请替换为实际接口地址)
# api_url = "http://116.63.110.220:19801/screenshot"
api_url
=
"http://localhost:19801/screenshot"
# 请求参数
url
=
"https://www.icourse163.org/course/WUST-1206144803?from=searchPage&outVendor=zw_mooc_pcssjg_"
url
=
"https://www.baidu.com/"
params
=
{
"url"
:
url
,
# 需要截图的目标 URL,
"width"
:
1290
,
# 指定宽度
"height"
:
700
# 指定高度
}
params
=
json
.
dumps
(
params
,
ensure_ascii
=
False
)
try
:
# 发送 GET 请求
response
=
requests
.
post
(
api_url
,
data
=
params
)
# 检查响应状态码
if
response
.
status_code
==
200
:
data
=
response
.
json
()
obs_url
=
data
[
'obs_url'
]
print
(
"目标网站截屏保存地址:"
,
obs_url
)
else
:
print
(
"error"
)
except
Exception
as
e
:
print
(
f
"发生异常: {str(e)}"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment