Friday, 14 October 2016

three login | htmlunit login example | form submit html | login example in java | three way login

three login | htmlunit login example | form submit html | login example in java | three way login


here, two way to login on form using HtmlUnit.
using this method you can setup by your custom website login.
you have to just modify your attribute by custom parameter.

Requrie library :- HtmlUnit

Wednesday, 12 October 2016

convert get request to post java | request param

convert get request to post java | request param

In some case convert post() request into get() request.
If your request is in post just try into get() else you try post()  (into webRequest HttpMethod.GET OR HttpMethod.POST)
Using HtmlUnit fire get() request. In some cases we need to pass parameter for getting response.
so we need to add parameter for request.
so,we set parameters and headers,browser(User-Agent) etc in request code.

Here,i used https://scrapemania.blogspot.in for request processing.
you update by your required site url.
also update parameter AND Host also Referer in WebRequest Header (startLinkCollectionPageSource() method).

Require Library :- HtmlUnit

get request java | get html page java | htmlpage java | set header in get request

get request java | get html page java | htmlpage java | set header in get request

Using HtmlUnit fire get() request. but,some cases response will not given by site properly. Difference like our String response not contain same as text like on our browser response text.
Because of our request is not browser.Actually server will confused it is not understand this is browser request.
so,we set headers,browser(User-Agent) etc in our code.

Here,i used https://scrapemania.blogspot.in for request processing.
you update by your required site url.
also update Host AND Referer in WebRequest Header (startLinkCollectionPageSource() method).

Requrie library :- HtmlUnit

Monday, 10 October 2016

excel reader in java | java xlsx reader | read xssfworkbook example in java

excel reader in java | java xlsx reader | read xssfworkbook example in java

Here code that read (.xlsx) file get appropriate manner,
it means here only three fields demo but you setup by your custom value datatype and add or delete your required fields.

 Requrie library :  ApachePOI
                             Poi-ooxml (if Xml Error) 

Input File :-


Saturday, 1 October 2016

import csv in mysql | how to read data from csv file in java

import csv in mysql | how to read data from csv file in java

In mysql insert .csv file regarding same manner fields.
you have to modify for your requirement table fields.

Requrie library : mysqlConnector

Table Script

CREATE TABLE `client_master` (
  `client_master_id` INT NOT NULL AUTO_INCREMENT,
  `client_name` VARCHAR(55) NULL,
  `client_region` VARCHAR(55) NULL,
  `client_order_number` VARCHAR(55) NULL,
  `client_status` INT(1) NULL,
  PRIMARY KEY (`client_master_id`));

Tuesday, 20 September 2016

generate xls file in java | poi hssf | generate excel file in java | java code to create a excel sheet

generate xls file in java | poi hssf | generate excel file in java | java code to create a excel sheet

Here code that generete Excel (.xls) file automatically.
you have to built by your self by your prices.
also calculate your price setting and getting Report by your custom requirement.
in that case you have connect by your database and set the values.
you have buit .jar and getting Report file automatically.

Requrie library :  ApachePOI

                             Poi-ooxml (if Xml Error)

generate xlsx file in java | poi xssf | generate excel file in java | java code to create a excel sheet

generate xlsx file in java | poi xssf | generate excel file in java | java code to create a excel sheet

 

Here code that generete Excel (.xlsx) file automatically.
you have to built by your self by your prices.
also calculate your price setting and getting Report by your custom requirement.
in that case you have connect by your database and set the values.
you have buit .jar and getting Report file automatically.

Requrie library : ApachePOI

                           Poi-ooxml   (if Xml Error)           

Thursday, 1 September 2016

json extract | json creation in java | json extract example | json extract data example

json extract | json creation in java | json extract example | json extract data example

Requrie library : JsonSimple

Here following example makes to generate a json regarding your data it may be different datatypes.
here it is hard-core data you make it dynamic.
also demostrate fetch data from JSONObject it may be different datatypes.


Tuesday, 30 August 2016

htmlunit click button without form | click button htmlunit | htmlunit click button example | click home button 3 ways

htmlunit click button without form | click button htmlunit | htmlunit click button example | click home button 3 ways

Requrie library : HtmlUnit

There are three different way to set text on textbox and clicked on button.

you just pass your HtmlPage and get new HtmlPage will contains like,
whenever you manually clicked on browser to click button and redirect page will display.


Tuesday, 2 August 2016

auto screen capture | automatic screenshot | take a screenshot

auto screen capture | automatic screenshot  | take a screenshot


Requrie library : FileUtils

steps for implement (only one time)
1) clean and build make .jar
2) put on startup.

Results
it will take photo/screenshot on you machine activity.
now this jar will fully automated. if you shutdown your machine and started it will take screenshot automatic.
get data in your C:\\screen you set path on your machine to copy images

Note:-
This program will help you to trace your machine activity for your absense.
so it will help you to know your machine activity doing your absense.


auto file copier | copy file in java | automatic file copier

auto file copier | copy file in java  | automatic file copier


Requrie library : FileUtils

steps for implement (only one time)
1) clean and build make .jar
2) put on startup.

Results
now this jar will fully automated. if you shutdown your machine and started it will copy your removable drive no need to copy and paste.
now you can attach removable drive.
get data in your C:\\data\2016-07-18-10-04-43_I
here i is your removable storage devices
so need need to mannual copy and paste.
it will copy automatically in datewise folder. no far for extensions

Note:-
This program will help you to copy any extension data.
from removable drive , cds , mobiles etc ...
which will you write in this program.
you can customized that.
kindly do not add letter which is your harddrive.

Friday, 1 July 2016

ViewState Request Using HtmlUnit

ViewState Request Using HtmlUnit


Requrie library : HtmlUnit

View state is authenticate to user will give response for fired request ?

user will not comes directly for some webpages in website(passing parameters only). so , viewstate restrict to give response to  for some pages. 

This example is demo for how to get response for passing stages for view state authentication for your request.

This example is give to viewstate values from his immediate parent page.than it is goes to next page for that is like a browser to give you response.


Wednesday, 29 June 2016

Post Request Using HtmlUnit

Post Request Using HtmlUnit

If you hit request without browser you have multiple libraries.

In one of that is HtmlUnit that will headless browser to hit the request.

In java you have hit request like post()/get() that depends open to urls and parameters that will required to bases for identify you request is from browser or not.
so, you need to pass the parameters that you need to authentication require from server side to process your request.

Requrie library : HtmlUnit