在linux的shell裡訪問一個URL

來源:互聯網
上載者:User

標籤:

有四種方法

1.elinks,用法舉例:

[[email protected] ~]$ elinks -dump http://www.baidu.com

2. wget 這個會將訪問的首頁下載到本地

[[email protected] ~]$ wget http://www.baidu.com
--2015-01-23 23:33:42-- http://www.baidu.com/
正在解析主機 www.baidu.com... 180.76.3.151
正在串連 www.baidu.com|180.76.3.151|:80... 已串連。
已發出 HTTP 要求,正在等待回應... 200 OK
長度:未指定 [text/html]
正在儲存至: “index.html”

[ <=> ] 89,094 258K/s in 0.3s

2015-01-23 23:33:43 (258 KB/s) - “index.html” 已儲存 [89094]

[[email protected] ~]$ ls
acs_server easycwmp_for_arm index.html shflags-1.0.3 模板 文檔 案頭
cross_easycwmp fishcorecpe rar test 視頻 下載
cwmpclient freecwmp rarlinux-5.2.0.tar.gz 公用的 圖片 音樂

index.html就是我們剛剛下載的。

 

3.curl會顯示出源碼

[[email protected] ~]$ curl http://www.baidu.com

4.lynx http://www.baidu.com

它會詢問你是否允許cookies,自己選就好

在linux的shell裡訪問一個URL

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.