I want to remove style attibute and replace it with unique class in html in java.
Input html:
<div style="A">
<div style="B">
</div>
<div style="C">
</div>
Output updated html:
<div class="class01">
<div class="class02">
</div>
<div class="class03">
</div>
Please tell me how can I do it easly in java!
I am trying to get using code available on:
http://www.java2s.com/Tutorial/Java/0120__Development/ParseHTML.htm
If you know any other good way, then please tell me! I don’t have rnd time and have to done soon.
Yes, there is. If you use jSoup, you can
I guess there are better ways to do this in jSoup, but this is the quickest I could do.
refer: http://jsoup.org/cookbook/modifying-data/set-attributes