小编bin*_*dhu的帖子

CutyCapt的替代品

有没有替代Cutycapt ..可以使用Java库访问....

简而言之,Cutycapt是一个跨平台的命令行实用程序,用于捕获WebKit将网页呈现为各种矢量和位图格式,包括SVG和PNG(1).

java cutycapt

10
推荐指数
1
解决办法
1928
查看次数

gwt RPC不起作用

我的代码有什么问题..

Public MyServiceAsync my=GWT.create(MyService.class);
    HTML serverResponseLabel = new HTML();
    public void onModuleLoad() {
        final Label errorLabel = new Label();
        RootPanel rootPanel = RootPanel.get();
        rootPanel.setSize("100%", "100%");
        rootPanel.add(errorLabel);
        serverResponseLabel=new HTML();
        rootPanel.add(serverResponseLabel);

        Button btnSearch = new Button("Search");
        rootPanel.add(btnSearch, 558, 110);
        btnSearch.setSize("63px", "29px");
                 btnSearch.addClickHandler(this);


    }
    @Override
    public void onClick(ClickEvent event) {
        // TODO Auto-generated method stub
        System.out.println("clicked");
        my.myMethod("ka",new AsyncCallback<String>() {
            public void onFailure(Throwable caught) {
                serverResponseLabel.setHTML(SERVER_ERROR);
            }

            public void onSuccess(String result) {
                serverResponseLabel.setHTML(result);
            }
        });
}

Sync
public interface MyService extends RemoteService {
  public …
Run Code Online (Sandbox Code Playgroud)

java gwt

4
推荐指数
1
解决办法
4218
查看次数

html解析器使用java搜索并替换一些值

我正在寻找一个可以搜索和替换锚标签的html解析器

ex
<a href="/ima/index.php">example</a>
to
<a href="http://www.example.com/ima/index.php">example</a>
Run Code Online (Sandbox Code Playgroud)

更新:

我的代码与jsoup但不工作

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

import com.google.common.collect.ImmutableList;
import com.google.common.net.InternetDomainName;

public class test {
    public static void main(String args[]) throws IOException {

          Document doc = Jsoup.connect("http://www.google.com").get();

          String html =doc.outerHtml().toString();

         // System.out.println(html);

           Elements links = doc.select("a");



            for (Element link : links) {
             String href=link.attr("href");
             if(href.startsWith("http://"))
             {

             }
             else
             {
                 html.replaceAll(href,"http://www.google.com"+href);
             }
            }
            System.out.println(html);
    }

}
Run Code Online (Sandbox Code Playgroud)

java html-parsing jsoup

2
推荐指数
1
解决办法
7519
查看次数

标签 统计

java ×3

cutycapt ×1

gwt ×1

html-parsing ×1

jsoup ×1