astrit

Untitled

Feb 10th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. private void handleAuthPage(String localUrl) throws IOException {
  2. HttpGet get = new HttpGet("https://auth.salesgenie.com" + localUrl);
  3.  
  4. appendFakeHeaders(get);
  5. CloseableHttpResponse authResponse = client.execute(get);
  6. Document document = Jsoup.parse(HttpClientUtil.textual(authResponse));
  7.  
  8. String wa = document.select("input[name=wa]").attr("value");
  9. String wresult = document.select("input[name=wresult]").attr("value");
  10. String wctx = document.select("input[name=wctx]").attr("value");
  11.  
  12. HttpPost post = new HttpPost("https://app.salesgenie.com/Home/Home");
  13. List<NameValuePair> params = new ArrayList<NameValuePair>();
  14. params.add(new BasicNameValuePair("wa", wa));
  15. params.add(new BasicNameValuePair("wresult", wresult));
  16. params.add(new BasicNameValuePair("wctx", wctx));
  17. post.setEntity(new UrlEncodedFormEntity(params));
  18.  
  19. appendFakeHeaders(post);
  20. client.execute(post);
Advertisement
Add Comment
Please, Sign In to add comment