S
S
strelkovandrey2018-05-15 15:56:37
bash
strelkovandrey, 2018-05-15 15:56:37

How can bash pull out the contents of a DIV by class name or other attribute?

Good afternoon, there is a wget html file in which you need to pull out the contents of a div container by a certain attribute

<div class="b-text clearfix js-topic__text mvhh" itemprop="articleBody">
   ...content...
  <div class="some_another class"> ... another content ... </div>
  ... again content ...
  <span> again and again content </span>
</div>

Ideally, you need to pull out on the basis of itemprop="articleBody" , i.e. get the contents of the container with the property itemprop="articleBody"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2018-05-15
@saboteur_kiev

Try like this
xmllint needs to be installed first ( apt-get install xmllint )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question