开发者

Render HTML Webpage to text in Java

开发者 https://www.devze.com 2023-01-15 18:21 出处:网络
I would like to get the text representation of a website in a human-readable form, for example hyperlink locations or input fields.

I would like to get the text representation of a website in a human-readable form, for example hyperlink locations or input fields.

Is there any library that does this? (I've checked Jericho Renderer but it does not show input fields)

For example

<div>
<form action="example.php">
Name:
<input type="text" name="name_field">
<input type="button" value="OK">
</form>
</div>

to something like this

Name: [_______开发者_高级运维_] [OK]


Try tag soup and build it yourself. You get a DOM model of the HTML and can spit out the text.

0

精彩评论

暂无评论...
验证码 换一张
取 消