2

I am currently working on a project that involves a lot of html parsing. I have come across and issue that I cannot find the solution to. Basically, what I have is an application that downloads html from a website and parses it (I am using HTMLCleaner as my parser). However, this website contains some javascript elements, which after execution change the html. What I need to do is execute the javascript function from my application and then download the html.

I have been looking for the solution for days, but all I managed to find was how to do this using WebView, which in my case I do not want.

I do have an idea for solving the problem, which is making an unrendered WebView and using that. However, I am sure there is one better then that.

Thank you in advance.

1 Answer 1

1

I have been looking for the solution for days, but all I managed to find was how to do this using WebView, which in my case I do not want.

You need something that knows how to render Web pages. Nothing else is going to do what you want (create a DOM, then run JavaScript that modifies that DOM).

I do have an idea for solving the problem, which is making an unrendered WebView and using that

That is one solution. Or, you could play around with Firefox's GeckoView, which will do similar stuff, just with their own rendering engine.

However, I am sure there is one better then that.

You can build your own Web browser from scratch.

Sign up to request clarification or add additional context in comments.

2 Comments

What about HTML parsers? I've done everything using HTMLCleaner until this point. Is there an alternative parser that can get the data after a javascript execution?
HTML parser will parse static HTML, but won't execute JS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.