Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • In my environment Lynx tool is not installed. And it is little tedious to make this installed in our environment. When I tried using only the awk command I am getting the below output <dt>Commodity Code & Dimension</dt>: <dd>151151.15 Dim 90 </dd> <dt>Commodity Serial #</dt>: <dd>2009081020</dd> <dt>Client Name</dt>: <dd>Jack</dd> Commented Jun 9, 2016 at 9:44
  • 1
    @ramp, parsing HTML is generally dangerous. Unless you are confident that the HTML tags will always be line-based, I encourage you to consider alternatives. Commented Jun 9, 2016 at 10:59
  • @ramp You should try to get lynx installed if you can. or links which is very similar (and can be used interchangeably for lynx in this particular case, but not in most other cases). There is no way that awk script will work without lynx or lynx - it was written to work with the output from either of them, not with raw HTML. In case it's not obvious, I was using lynx as a HTML parser to convert the input from HTML to plain text, so it could be processed with awk. Commented Jun 9, 2016 at 13:13
  • lynx is a very common text mode web browser, and particularly useful for this kind of task because it is very forgiving of broken HTML - as a web browser, it has to be in order to cope with all the truly awful HTML code that millions of sites on the web emit. Most XML & HTML parsers are very strict in what they accept, they expect properly formatted valid XML/HTML and often just won't work with sufficiently broken input. Commented Jun 9, 2016 at 13:16