I am successful to record all the links of the website but missed some of the links which can only be visible with the form posting (for example login). 
What i did is recorded all the links without login. And took the form values. Then i posted the data and recorded the new links, but here i missed the other forms and links which are not in that posted links.
Please suggest any efficient algorithm so that i could grab all the links by posting form datas.
Thanks in advance.
The links in a set of web pages can be seen as a tree graph and hence you could use various tree traversal algorithms like depth first and breadth first search to find all links. The links and related form data can be saved in a queue or stack depending on what traversal algorithm you are using.
Algorithm for traversing website including forms