2007-10 Awk Urls From Html

It's about getting urls from xhtml/html files

# Get url's of files which are in html file

BEGIN { RS="<"; FS=">"; }

function displayurl(url) { print url }

/href/ { 
    gsub(" ",""); 
    sub(".*href=\"","")
    url=substr($0,1,index($0,"\"")-1)
    displayurl(url)
}
/HREF/ { 
    gsub(" ",""); 
    sub(".*HREF=\"","")
    url=substr($0,1,index($0,"\"")-1)
    displayurl(url)
}
/src/ { 
    gsub(" ",""); 
    sub(".*src=\"","")
    url=substr($0,1,index($0,"\"")-1)
    displayurl(url)
}
/SRC/ { 
    gsub(" ",""); 
    sub(".*SRC=\"","")
    url=substr($0,1,index($0,"\"")-1)
    displayurl(url)
}
O ile nie zaznaczono inaczej, treść tej strony objęta jest licencją Creative Commons Attribution-ShareAlike 3.0 License