0

I have a java web app where i need to use a simple web crawler to read html from webpages. I could not find any simple solution for this in java. But got a very simple python script that solve my problem. Now how to call that python script (.py) from my java class and also get the returned value from the python script .Thanks in advance .

2
  • The jsoup library looks very simple, you can load HTML in one call and it has selectors so you can pull out elements easily. I think getting python integrated will be much harder than using such a library. Commented Feb 5, 2015 at 1:12
  • Also if you need a method to load HTTP from a site, you could use Apache HTTPClient. Commented Feb 5, 2015 at 1:13

1 Answer 1

1

First check out Calling Python in Java?

Another approach might be to call the python interpreter from the command line with a Java Process. See Java Process with Input/Output Stream and Call python script within java code (runtime.exec)

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.