Get content between a pair of HTML tags using Bash

前端 未结 6 642
野趣味
野趣味 2020-11-30 09:53

I need to get the HTML contents between a pair of given tags using a bash script. As an example, having the HTML code below:



         


        
6条回答
  •  生来不讨喜
    2020-11-30 10:38

    BASH is probably the wrong tool for this. Try a Python script using the powerful Beautiful Soup library instead.

    It will be more work upfront but in the long run (here: after one hour), the time savings will make up for the additional effort.

提交回复
热议问题