解决方案
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<a id='links' href="#" style='display:none;'></a>
<script type="text/javascript">
var obj = document.getElementById('links');
obj.href = "http://www.baidu.com";
obj.click();
</script>
</body>
</html>
转自
https://blog.csdn.net/lizhixin705/article/details/52984328