Using grep to extract html from container tags -
Using grep to extract html from <div> container tags -
i have page has many posts different authors. want posts user page of posts.
how can set grep @ each post's html block in page author, print content of post file? post construction like
<!--begin msg number #####--> [useless junk i'm not interested in here] <span class="author vcard"><a class="url fn" href='url here'>user a</a> </span> [more junk] <div class='post entry-content '> <!--cached-some date string--> here's text want extract </div> [more junk] <hr />
i think construction
grep /pattern/ output file
but need explicitly tell hunt between
<!-- begin msg ... -->
and
<hr />
tags bound post, or grep smart plenty automatically? i'm worried when grep finds pattern of user a, print post contents file instead of particular one.
if post text on 1 line, try
grep /(author vcard|<!--cached-)/
html grep
Comments
Post a Comment