我想使用wget獲得此頁面的結果http://smart.embl-heidelberg.de/smart/batch.pl如何使用wget下載帶有html表單(post方法)的頁面?
我在該頁面上單擊「純文本輸出」,並將「標識符」文件指定爲具有以下內容的文件。
A0A183
然後我點擊 「提交查詢」,這將導致我的結果頁面。我知道我應該以某種方式爲wget提供--post-data選項以下載結果頁面。但我很難弄清楚這個選項應該是什麼。任何人都可以讓我如何弄清楚它? (我試過Chrome Devtools Network選項卡,但我不確定從那裏獲得--post-data選項)。
我也試過以下。但它生成了一個空的輸出文件。
~$ cat /tmp/000.txt
A0A183
~/linux/test/perl/library/WWW/Mechanize/bin/mech-dump$ mech-dump --forms http://smart.embl-heidelberg.de/smart/batch.pl
GET http://smart.embl-heidelberg.de/smart/search.cgi
keywords=keywords... (text)
<NONAME>=Search SMART (submit)
POST http://smart.embl-heidelberg.de/smart/batch.pl (multipart/form-data)
IDS= (textarea)
SEQS= (textarea)
IDFILE= (file)
SEQFILE= (file)
TEXTONLY=<UNDEF> (checkbox) [*<UNDEF>/off|1/Text-only output]
LOOSE=<UNDEF> (checkbox) [*<UNDEF>/off|1/Substring matching for identifiers]
DO_PFAM=<UNDEF> (checkbox) [*<UNDEF>/off|DO_PFAM/include PFAM domains]
INCLUDE_SIGNALP=<UNDEF> (checkbox) [*<UNDEF>/off|INCLUDE_SIGNALP/include signal peptides]
<NONAME>=<UNDEF> (submit)
<NONAME>=<UNDEF> (reset)
~$ wget --post-data='IDFILE=/tmp/000.txt&TEXTONLY=1' http://smart.embl-heidelberg.de/smart/batch.pl
或'捲曲-d IDS = A0A183 -d純文字= 1的http://smart.emb 1-海德堡。 de/smart/batch.pl' – nickromano
@Al Pacifico,我需要使用選項IDFILE而不是IDS,因爲我需要在我的真實情況下提供數千個ID。 – user1424739