I was having trouble finding any documentation at all on a type of parsing I need to do for a Java string.
So, It’s not something simple like parsing by lines or commas or something, it’s a bit more complicated.
My program grabs a web page’s source, and I need to parse it for the content of a view tags.
Something like parsing it for what’s between
<input name="sid" type="hidden" value="
and
" />
So, if the web page had this string:
<input name="sid" type="hidden" value="stringvaluehere" />
It would output
stringvaluehere
Can anyone help? I’ve found no sort of documentation on anything like this at all, and asking around at other sources has been no help.
Thanks!
You could use a library for this, such as JSoup. It’s often much easier than trying to parse the DOM manually.
Simple to use & importantly easy to read.