获取链接地址 js 太小白了
本帖最后由 K0K000 于 2021-11-23 14:42 编辑<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta content="always" name="referrer"/>
</head>
<body>
<script th:inline="javascript">
/*<![CDATA[*/
function bol(){
if (top.location != self.location) {
return false;
}
var real_jump_address = 'https://s.click.taobao.com/t?union_lens=lensId%3AOPT%401637582776%402127e372_0abc_17d478a2761_d05d%4001&e=m%3D2%26s%3DYL1tGTdtXOVw4vFB6t2Z2ueEDrYVVa64MljcGUdc4HdyINtkUhsv0KDj0kgG4W%2FNLknuM4vEeqn%2F6YnwB7gmRrxYepXMO9dPPcPHeFJh09g1WmX40VYCe7wJBiNCwGbxR04roaaYUn7w%2FaGe1QkIvmV10D5zBFYES5q3ysAI%2BkNjitB%2FgBeFdiGFCzYOOqAQ&sc=QBqSadu&ref=&et=XDe%2FKS7s7NyhnVyCk1S9a%2FiREkOqg2a9'
if (!window.attachEvent) {
document.write('<input style="display:none" type="button" id="exe" value="">');
document.getElementById('exe').click();
} else {
document.write('<a style="display:none" href="' + real_jump_address + '" id="exe"></a>');
document.getElementById('exe').click();
}
}//end of bol()
bol();
/*]]>*/
</script>
</body>
</html>
这里面的js代码 有一个button document.getElementById('exe').click(); 这个会自动点击后 到一个淘宝商品页面 我用python 不自动怎么取跳转后淘宝页商品 链接 也就是商品链接
function bol(){
if (top.location != self.location) {
return false;
}
var real_jump_address = 'https://s.click.taobao.com/t?union_lens=lensId%3AOPT%401637582776%402127e372_0abc_17d478a2761_d05d%4001&e=m%3D2%26s%3DYL1tGTdtXOVw4vFB6t2Z2ueEDrYVVa64MljcGUdc4HdyINtkUhsv0KDj0kgG4W%2FNLknuM4vEeqn%2F6YnwB7gmRrxYepXMO9dPPcPHeFJh09g1WmX40VYCe7wJBiNCwGbxR04roaaYUn7w%2FaGe1QkIvmV10D5zBFYES5q3ysAI%2BkNjitB%2FgBeFdiGFCzYOOqAQ&sc=QBqSadu&ref=&et=BpKSJDdI%2FJX9tfjMrBZU1s%2BxBfpuECwQ'
if (!window.attachEvent) {
document.write('<input style="display:none" type="button" id="exe" value="">');
document.getElementById('exe').click();
} else {
document.write('<a style="display:none" href="' + real_jump_address + '" id="exe"></a>');
document.getElementById('exe').click();
}
}//end of bol()
bol();
这段js中的url不自动怎么获取
顶一下,第一个, 能优化排版去背景么 本帖最后由 知心 于 2021-11-23 09:00 编辑
要善用论坛的代码标签功能 js代码 什么叫不自动获取 年轻人喜欢这么花里胡哨的背景色和配色吗 这个背景看着头疼.... 同感,你这背景配色,直接就想关掉,不想看了 import re
html = '''
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta content="always" name="referrer"/>
</head>
<body>
<script th:inline="javascript">
/*<![CDATA[*/
function bol(){
if (top.location != self.location) {
return false;
}
var real_jump_address = 'https://s.click.taobao.com/t?union_lens=lensId%3AOPT%401637582776%402127e372_0abc_17d478a2761_d05d%4001&e=m%3D2%26s%3DYL1tGTdtXOVw4vFB6t2Z2ueEDrYVVa64MljcGUdc4HdyINtkUhsv0KDj0kgG4W%2FNLknuM4vEeqn%2F6YnwB7gmRrxYepXMO9dPPcPHeFJh09g1WmX40VYCe7wJBiNCwGbxR04roaaYUn7w%2FaGe1QkIvmV10D5zBFYES5q3ysAI%2BkNjitB%2FgBeFdiGFCzYOOqAQ&sc=QBqSadu&ref=&et=BpKSJDdI%2FJX9tfjMrBZU1s%2BxBfpuECwQ'
if (!window.attachEvent) {
document.write('<input style="display:none" type="button" id="exe" value="">');
document.getElementById('exe').click();
} else {
document.write('<a style="display:none" href="' + real_jump_address + '" id="exe"></a>');
document.getElementById('exe').click();
}
}//end of bol()
bol();
/*]]>*/
</script>
</body>
</html>
'''
url = ''.join(re.findall(r"real_jump_address = '([\s\S]*?)'", html))
print(url)
页:
[1]
2