Python 爬取 mp3 有声书
import json, time, requests, re
from bs4 import BeautifulSoup
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:38.0) Gecko/20100101 Firefox/38.0','Accept':'*/*'}
def xyp(id='210'):
url='http://xx.com/audio_'+id+'.html'
req = requests.get(url, timeout = 20)
req.encoding = 'utf-8'
smp3=re.search('h/aaa/bb/(.+).mp3', req.text).group(1)
result='http://xx2.com/data1/h/aaa/bb/'+smp3+'.mp3'
print(result)
res = requests.get(result)
with open(r'/root/xyp/'+smp3+'.mp3', 'ab') as file:
file.write(res.content)
file.flush()
return 1
for i in range(1,1286):
xyp(str(i))Python Excel 截图
win32com.client Dispatch pythoncom PIL shutil os
注意清空剪贴板os.system("echo off | clip")
js html 网页内弹窗
<script>
function openDialog(id,tool,assembly) {
$("#addBtn").html("<div style='position: absolute;width: 600px;height: 300px;top: calc(50% - 150px); left: calc(50% - 300px);background-color:white; border:2px solid blue'><form align=center action=log.php method=get><h3>Title</h3><input type=hidden name=act value=close /> <input name=id type=hidden readonly value='"+id+"' /> <input name=tool type=hidden readonly value='"+tool+"' required /> <input name=assembly type=hidden readonly value='"+assembly+"' required /> <button class='btn btn-primary' type=submit>submit</button> <button class='btn btn-secondary' onclick='closeDialog()'>cancel</button></form></div>");
}
function closeDialog() {$("#addBtn").html("");}
</script>
<a href='#' onclick=\"openDialog({$value['id']},'{$value['Tool']}','{$value['Assembly']}')\" title='Click here to close the Issue'>Close Issue</a>
<div id="addBtn"></div>php sqlite
if (strstr($_SERVER['HTTP_USER_AGENT'],"Chrome")) {$smsg="<br>Please Use IE";}
$_REQUEST['Log'] = str_replace(PHP_EOL, "<br>", $_REQUEST['Log']);
$oldDetail='/<span style="padding:4px;background:[a-zA-Z;]{3,12}">'.$v.'<\/span>/';
$newDetail='<span style="padding:4px;background:Red">'.$v.'</span>';
if ($red) { $detail=preg_replace($oldDetail,$newDetail,$detail); }
UPDATE tool SET Symptom= REPLACE(Symptom,'a','b')
UPDATE log SET Status='Red' WHERE Status='Yellow' and (julianday('now')-julianday(Time))>14