我正在尝试编写一个脚本,下载最新版本的flashplayer tarball并将其解压缩。我应该这么简单。
但是"立即下载"此页面上的链接解析为" https://get.adobe.com/flashplayer/download/?installer=Flash_Player_11.2_for_other_Linux_(.tar.gz)_64-bit&standalone=1,当我执行以下行
时 wget "http://get.adobe.com/flashplayer/download/?installer=Flash_Player_11.2_for_other_Linux_(.tar.gz)_64-bit&standalone=1"
它产生
--2015-05-08 08:56:49-- http://get.adobe.com/flashplayer/download
/?installer=Flash_Player_11.2_for_other_Linux_(.tar.gz)_64-
bit&standalone=1
Resolving get.adobe.com (get.adobe.com)... 192.150.16.58
Connecting to get.adobe.com (get.adobe.com)|192.150.16.58|:80...
connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to:
`index.html?installer=Flash_Player_11.2_for_other_Linux_(.tar.gz)_64-
bit&standalone=1.1'
[ <=> ] 10,904 --.-K/s in
0.06s
2015-05-08 08:56:49 (174 KB/s) -
`index.html?installer=Flash_Player_11.2_for_other_Linux_(.tar.gz)_64-
bit&standalone=1.1' saved [10904]
显然wget没有像我的浏览器那样理解链接,因为文件大小是174KB而不是6.91MB。
有谁能告诉我问题是什么/我应该做什么呢?感谢
编辑:
在html页面中找到了这个
70 <script>
71
72 setTimeout("location.href = 'https://fpdownload.macromedia.com/get/flashplayer/pdc/11.2.202.457/install_flash_player_11_linux.x86_64.tar.gz';", 2000);
73
74
75 $(function() {
76 $("#whats_new_panels").bxSlider({
77 controls: false,
78 auto: true,
79 pause: 15000
80 });
81 });
82 setTimeout(function(){
83 $("#download_messaging").hide();
84 $("#next_button").show();
85 }, 10000);
86 </script>
如果我忘了那个链接就行了。
答案 0 :(得分:1)
正如@houssam所说,给定的页面是一个包含javascript部分的html页面
setTimeout("location.href = 'https://fpdownload.macromedia.com/get/flashplayer/pdc/11.2.202.457/install_flash_player_11_linux.x86_64.tar.gz';", 2000);
因此,如果您要动态下载它,则需要提取location.href的新值并将您的wget设置为该值。否则,只需使用the download link。