diff --git a/.gitignore b/.gitignore index eac1192735b66315731f3920d5f5174d74dd5b33..2873e85017a23cd65073af2ad8542a8c88c08005 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ static/uploads/*.png -google* \ No newline at end of file diff --git a/google-chrome-stable_current_amd64.deb b/google-chrome-stable_current_amd64.deb new file mode 100644 index 0000000000000000000000000000000000000000..2a780e7d151952d903d6c813e5dda89401227a19 Binary files /dev/null and b/google-chrome-stable_current_amd64.deb differ diff --git a/install.sh b/install.sh index 588e66f4547fa12f812396323622a26ea8523a3b..86b01f5798aa99231824ed514c4e994df36bf43b 100644 --- a/install.sh +++ b/install.sh @@ -1,8 +1,8 @@ -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/中 diff --git a/main.py b/main.py index 88f51d792ee405d97969d88b7b0a8fef8f550d53..8ce479539edb3ebd076e802edc940449e2eea82d 100644 --- a/main.py +++ b/main.py @@ -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() diff --git a/static/uploads/8eb10bfb5b934b88.png b/static/uploads/8eb10bfb5b934b88.png deleted file mode 100644 index a859187ce550676b1cd1cab9ce0cf55a8173ca0e..0000000000000000000000000000000000000000 Binary files a/static/uploads/8eb10bfb5b934b88.png and /dev/null differ