0

I have one requirement, have one dynamic "HTML" page code i want to convert it to string (JAVA) and send to another interface for processing, How should i convert HTML to String? HTML code contains "" to define id's when converting to string it is taking starting " and between id " as one string.

"<html> <head>
<meta name="generator" content="HTML" "... So on.

<div class="zyx">#Title 1</div>
<div class="abc"><p>Some Content</p></div>

Since it html page contains (double quotes)".." it is not able to convert it, and giving error. Requirement i want whole html page in STRING format Can anyone tell me how should i convert HTML to String in best optimised way? Anyway to parse html page?

Buhake Sindi
  • 87,898
  • 29
  • 167
  • 228
Ayush Rawat
  • 65
  • 2
  • 9

1 Answers1

0

You can encode the string with some HTML encoder and send it to the other interface. This interface will decode the string and will process it.

Example of how the html encoder works:

Before: "asdas"

After: &quot;asdas&quot;

You can test it here: http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/Encode.aspx

Mosh Feu
  • 28,354
  • 16
  • 88
  • 135