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:
Using sed in shell/bash, so you needn't install something else.
tag=body sed -n "/<$tag>/,/<\/$tag>/p" file