2015-10-06 37 views
0

我想從互聯網上隨機下載多個Excel文件(例如.xls,.xlsx,.xlsm)。將google的結果寫入html頁面

首先,我有.xlsx作爲後綴的「google」文件。我有以下的外殼:

for ((i=0 ; i<400 ; i=i+10)) ; do 
    wget -O $i.html "https://www.google.fr/?gws_rd=ssl#q=filetype:xlsx&start=$i" 
done 

上述外殼產生0.html10.html ......奇怪的是,所有生成的頁面是一樣的:

enter image description here

有誰知道什麼是錯在我的代碼?

回答

0

wget在這方面的潛力是有點有限的,你可以嘗試使用,例如,

lynx -dump "http://google.com/search?hl=en&safe=off&q=filetype:xlsx&start=$i" > output 

然而,人們應該保持Google Terms of Service記住,尤其是:

唐不會濫用我們的服務。例如,請勿干擾我們的服務或嘗試使用接口和我們提供的說明以外的方法訪問它們。

+0

我看到'...'在提取的地址中,例如'www.phoutcomes.info /.../ PHOF_inequalities_data_available_May_2015.xlsx'。如何避免這種情況? – SoftTimur

+1

查詢字符串是什麼?通常,'lynx'返回一個格式化的「列表」,其中每個鏈接被分配一個數字,完整鏈接列表可以在 – ewcz

+0

'lynx -dump「http://google.com/search? hl = en&safe = off&q = filetype:xlsx&start = 30「> 30.html' – SoftTimur