gpt4 book ai didi

php - 从 javascript 函数解析链接

转载 作者:行者123 更新时间:2023-11-28 16:07:53 25 4
gpt4 key购买 nike

我正在尝试从页面内的 javascript 函数解析直接链接。我能够解析我需要的 html 信息,但对 javascript 部分感到困惑。这是可以通过 php 和正则表达式实现的吗?

function videoPoster() {
document.getElementById("html5_vid").innerHTML =
"<video x-webkit-airplay='allow' id='html5_video' style='margin-top:"
+ style_padding
+ "px;' width='400' preload='auto' height='325' controls onerror='cantPlayVideo()' "
+ "<source src='http://video-website.com/videos/videoname.mp4' type='video/mp4'>";
}

我需要拉出链接“http://video-website.com/videos/videoname.mp4”。任何帮助或指示将不胜感激!

最佳答案

/http://.*\.mp4/ 将为您提供 http://.mp4 之间的所有字符(含) .

See it in action.

如果您需要 session ID,请使用类似 /http://.*\.mp4?sessionid=\d+/

关于php - 从 javascript 函数解析链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14132065/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com