Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

How do I convert javascript to html?

Asked by Rohit Jhadav Oct 14, 2022 1.4K views 1 answer
Share

About this question

Take for example this snippet of code on a web page.

<html><body> [removed] [removed]("The cat"); [removed](" sat on the mat"); [removed] </body></html>

If I were to retrieve this web page via CURL or WGET I would get that text because the Javascript has not been processed.

But I would like to retrieve this page, so I get the results of the Javascript output. So I would get just..

The cat sat on the mat

Is there some Linux Javascript sandbox/emulator/preprocessor or something of that ilk that would allow me to process that text into html. I understand Javascript is complex and don't expect 100% conversion. But even to get some basic conversion would be helpful.

I know it's possible as I'm sure Google does that when they index web pages to get the best results for the web pages they index.

Your answer

1 Answer

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.