phoenix007 has asked for the wisdom of the Perl Monks concerning the following question:
I want to modify HTML using HTML::TreeBuilder. I was trying to parse plain text and identify urls and modify them with <a hrel="url">url</p>
If I have following line in my HTML :
<p>test1 www.google.com <a href="www.google.com">www.google.com</a> test2</p>
I want to modify it to :
<p>test1 <a href="www.google.com">www.google.com</a> <a href="www.google.com">www.google.com</a> test2</p>
Here I am facing two problems : I am not getting proper count of child contents so that I can modify them I get total_contents as 1 for p. Second problem is I am not able to insert new HTML::Element inside text of p
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: HTML content editing using HTML::TreeBuilder
by Tux (Canon) on Apr 10, 2019 at 07:58 UTC | |
Re: HTML content editing using HTML::TreeBuilder
by skleblan (Sexton) on Apr 10, 2019 at 23:10 UTC | |
Re: HTML content editing using HTML::TreeBuilder
by Anonymous Monk on Apr 10, 2019 at 19:16 UTC |
Back to
Seekers of Perl Wisdom