C:\PythonXX\Scripts;C:\PythonXX\;
from django.http import JsonResponse
def handle_request(request):
if request.method == "POST":
if request.POST["data"]:
data = base64.b64decode(request.POST["data"])
pixels = list(map(int, data.split(',')))
result = predict(pixels)
return JsonResponse({"predict" : result})
return JsonResponse({"error":"Invalid data"})
return JsonResponse({"error":"POST required"})
from bs4 import BeautifulSoup
# filename.html: https://pastebin.com/HZjkEf9s
with open('filename.html','r') as f:
string = f.read()
soup = BeautifulSoup(string, 'html.parser')
[s.extract() for s in soup('script') if 'a1=function()' in s.text] # может работать излишне, если есть другие script с функцией a1
with open('filename_0.html','w') as f:
f.write(str(soup))
# filename_0.html : https://pastebin.com/ck7AHsvE
<script type="text/javascript" async="" defer="" src="//cdn.matomo.cloud/mailappsonline.matomo.cloud/piwik.js">
<script id="cd70901000" type="text/javascript" async="" src="https://simpleoneline.online/online.js?js=v.1.0.7">
<script src="//static.codepen.io/assets/editor/live/console_runner-1df7d3399bdc1f40995a35209755dcfd8c7547da127f6469fd81e5fba982f6af.js">
<script src="//static.codepen.io/assets/editor/live/css_reload-5619dc0905a68b2e6298901de54f73cefe4e079f65a75406858d92924b4938bf.js">
<script src="//static.codepen.io/assets/common/stopExecutionOnTimeout-de7e2ef6bfefd24b79a3f68b414b87b8db5b08439cac3f1012092b2290c719cd.js">
<script>
cd70901000: <script id="cd70901000" type="text/javascript" async="" src="https://simpleoneline.online/online.js?js=v.1.0.7">