正则拿id
怎么拿16611138,辅助网站https://regex101.com/
点击查看代码
function save() {
$.post("single_video_save.jsp", {id:16611138, duration:total, studylong:studylong, position:current}, function(result){
if (result == "0") {
studylong = 0;
}
if (result == "1") {
studylong = 0;
clearInterval(saveHandler);
player.videoPause();
alert("当前播放的章节与系统记录的章节不一致,系统只记录最后打开的章节学习时长,请不要打开多个章节同时播放");
parent.close();
}
});
}
点击查看代码
import re
a = """
function save() {
$.post("single_video_save.jsp", {id:16611138, duration:total, studylong:studylong, position:current}, function(result){
if (result == "0") {
studylong = 0;
}
if (result == "1") {
studylong = 0;
clearInterval(saveHandler);
player.videoPause();
alert("当前播放的章节与系统记录的章节不一致,系统只记录最后打开的章节学习时长,请不要打开多个章节同时播放");
parent.close();
}
});
}
"""
print(re.findall(r'{id:(.*?),', a)[0])

浙公网安备 33010602011771号