Fri May 5 05:06:03 UTC 2023 inscode

上级 ed319383
static/uploads/*.png
google*
\ No newline at end of file
wget 'https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb'
# wget 'https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb'
dpkg -i google-chrome-stable_current_amd64.deb
apt --fix-broken install -y
dpkg -i google-chrome-stable_current_amd64.deb
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install -r requirements.txt
mkdir -p /usr/share/fonts/chinese/ #创建中文字体目录
cp simsun.ttf /usr/share/fonts/chinese/ #将字体文件拷贝到/usr/share/fonts/chinese/中
......
......@@ -4,7 +4,7 @@ from flask import Flask, render_template, request, send_file, jsonify
# import os
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = 'static/uploads/'
# import time
import time
def take_screenshot(url):
# 创建 Chrome 浏览器对象
......@@ -20,7 +20,7 @@ def take_screenshot(url):
driver.get(url)
# time.sleep(5)
driver.implicitly_wait(10)
driver.implicitly_wait(100)
file_name = 'static/uploads/screenshot.png'
driver.save_screenshot(file_name)
driver.quit()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册