當前位置:編程學習大全網 - 網站源碼 - shell如何獲取html頁面的title和description裏的內容

shell如何獲取html頁面的title和description裏的內容

假設妳的html頁面文件為test.html:

下列命令獲取title的內容:

cat test.html | tr [TITLE] [title] | grep '<test>.*</title>' | sed 's/<title>\(.*\)<\/title>/\1/g'

description的語法我看不大明白,所以不知道怎麽提取。

只簡單測試了壹下,LZ可以試試。

  • 上一篇:jre是什麽
  • 下一篇:板塊整體商品盈利指數分析?
  • copyright 2024編程學習大全網