开发者

Get source code from another domain with unsigned Java applet [duplicate]

开发者 https://www.devze.com 2023-03-28 02:06 出处:网络
This question already has an answer here: Closed 11 years ago. Possible Duplicate: Java and crossdomain.xml
This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

Java and crossdomain.xml

I need an unsigned (I don't want prompt for visitors asking to run the applet) Java applet that scrape source code from another domain. I have made an applet using prowser library, when I execute it on eclipse (as applet) or as runnable jar it works but it don't work when I execute the applet on my website. It returns me "null".

My applet code :

import java.applet.Applet;   

public class HelloWorldApplet extends Applet {

public void init() {

    Prowser prowser开发者_如何学C = new Prowser();
    Tab tab = prowser.createTab();
    System.out.println(tab.go("http://www.canyouseeme.org").getPageSource());    

   }

} 

Previously I have had an issue with the import of the library: Export Applet Java with referenced libraries

Thanks in advance for your help.


Put the code that scrapes the other site on your server (i.e., in a servlet), then have the applet talk to the servlet via HTTP (REST, web services, whatever.)

0

精彩评论

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