Python program that validates an url against w3c markup validator

tleeuwenburg at gmail.com tleeuwenburg at gmail.com
Wed Nov 29 00:35:03 EST 2006


urls = [("/tmp/validate1.html", "http://www.theage.com.au")]

for url, outputfile in urls:
   commandString = 'wget -o %s http://validator.w3.org/check?uri=%s' %
(outputfile, url)
   system.exec(commandString)

is one easy way.

yaru22 wrote:
> I'd like to create a program that validates bunch of urls against the
> w3c markup validator (http://validator.w3.org/) and store the result in
> a file.
>
> Since I don't know network programming, I have no idea how to start
> coding this program.
>
> I was looking at the python library and thought urllib or urllib2 may
> be used to make this program work.
>
> But I don't know how to send my urls to the w3c validator and get the
> result.
>
> Can anyone help me with this? or at least give me a hint?
> 
> Thank you so much.




More information about the Python-list mailing list