I have a code which gets all the links from a webpage. The formats could be:
1) http://www.domain/folder/file.htm
2) www.domain/folder/file.htm
3) http://domain/folder/file.htm
4) /folder/file.htm
5) file.hmt (relative)
I want to create a procedure which takes as parameters the link and the link from the html which parsed and returns the link in the format:
1) http://domain/folder/file.htm or
2) http://www.domain/folder/file.htm
Example:
Code: Select all
proc format_url { link parent } {
...
}
Thanks