
Parsing an HTML Document - Change Relative paths to fully qualified paths
Hi all!
I want to parse an HTML document and change all of the relative
paths for the (<img src> <a href> <form action>) tags to fully qualified url
paths
with the domain name.
For instance,
src="/pics/mypic.jpg" would become
src=" http://www.*-*-*.com/ ;
This seems easy enough with the replace function, right? For instance:
mydomain = http://www.*-*-*.com/
sHTMLDoc = replace(sHTMLDoc, "src=" & chr(34), "src=" & chr(34) & mydomain)
But, what if the src is equal to
src=" http://www.*-*-*.com/ ;
before using the Replace function? Then I would end up with
src=" http://www.*-*-*.com/ ://www.mydomain.com/pics/mypic.jpg"
Any ideas or suggestions on how to attack this would be highly
appreciated... Thanks!
Scott