예제 #1
0
  private static void loginUpwork() {
    BrowserEngine webkit = BrowserFactory.getWebKit();
    Page page = webkit.navigate("https://www.upwork.com/Login");
    //		page.show();
    Document doc = page.getDocument();
    doc.query("#login_username").get().setValue("*****@*****.**");
    doc.query("#login_password").get().setValue(FileUtils.UP);
    //		doc.query("#login_rememberme").get().ajaxClick().ajaxClick();
    Element button = doc.query("#layout form button").get();
    button.removeAttribute("disabled").removeAttribute("disabled").click();

    Utils.waitUntil(doc, obj -> ((Document) obj).query("#jsJobResults").isPresent());
    print(doc.query("#jsJobResults").get().getText());
    webkit.shutdown();
  }
예제 #2
0
  public static void loginFreelancer() {
    BrowserEngine webkit = BrowserFactory.getWebKit();
    System.setProperty("jsse.enableSNIExtension", "false");
    Page page = webkit.navigate("https://www.freelancer.com/logged-out/");
    System.clearProperty("jsse.enableSNIExtension");
    Document doc = page.getDocument();

    /*HeadlessBrowser.ajaxClick(doc, "#login-normal", "#login_form");

    		doc.query("#username").get().setValue("*****@*****.**");
    		doc.query("#passwd").get().setValue(FileUtils.UP);
    		HeadlessBrowser.ajaxClick(doc, "#login_btn", "#profile-figure");

    		print(doc.query("#project-feed").get().getText());
    //		page.getView().*/
    webkit.shutdown();
  }
예제 #3
0
  public static void getHMAList() {
    BrowserEngine webkit = BrowserFactory.getWebKit();
    Page page = webkit.navigate("http://proxylist.hidemyass.com/");
    Document doc = page.getDocument();
    print(doc.query("#listable > tbody").get().getChildren().size());

    doc.query("#proxy-search-form select[name='pp']")
        .get()
        .getSelect()
        .get()
        .getOption(3)
        .setSelected(true);
    doc.query("#proxy-list-upd-btn").get().click();
    Utils.waitUntil(doc, obj -> ((Document) obj).queryAll("#listable > tbody > tr").size() == 100);
    List<Element> rows = doc.queryAll("#listable > tbody > tr");
    print(rows.size());
    webkit.shutdown();
  }