【发布时间】:2022-02-03 17:38:02
【问题描述】:
如何使用 Python 从 HTML 脚本中提取 URL?
提供的 HTML:
function download() {
window.open('https:somelink.com');
}
const text = `<div style=\'position: relative;padding-bottom: 56.25%;height: 0;overflow: hidden;\'>
<iframe allowfullscreen=\'allowfullscreen\' src=\'URL\' style=\'border: 0;height: 100%;left: 0;position: absolute;top: 0;width: 100%;\' ></iframe>
</div>`;
function embed() {
var element = document.getElementById('embed-text');
console.log(element);
element.innerHTML = text
}
期望的输出是:
https://somelink.com
任何帮助都可以。谢谢!
【问题讨论】: