Moved output to file

* The output to file was done to late.
* Added some more info when searching for urls in page.