0

I'm trying to use this python script to upload a file to the w3c validator.

~/Desktop/urllib2_file$ python test-upload.py -u http://validator.w3.org/ -f ../index.php -n uploaded_file -p Content-Type=text/html > ../results.html && firefox ../results.html

Any help will be greatly appreciated!

EDIT:

cyraxjoe pointed out I needed to run it through php first. I tried this, but got the same result:

php -f /opt/lampp/htdocs/index.php > index.html && python urllib2_file/test-upload.py -u http://validator.w3.org/ -f index.html -n uploaded_file -p Content-Type=text/html > results.html && firefox results.html
Nona Urbiz
  • 4,873
  • 16
  • 57
  • 84
  • Why don't you validate directly with [pytidylib](http://countergram.com/software/pytidylib)? (Discussed in question: [Validate (X)HTML in Python](http://stackoverflow.com/a/1279293/775066)) – sumid Oct 22 '12 at 22:29

1 Answers1

1

You are uploading a php-script which is a server-side script, you need to upload the resulting html after the php procesing. Perhaps with php-cli then store in a file the resulting text and upload that file.

cyraxjoe
  • 5,661
  • 3
  • 28
  • 42
  • thats a great point, but i've tried this now, and still the same end result: php -f /opt/lampp/htdocs/index.php > index.html && python urllib2_file/test-upload.py -u validator.w3.org -f index.html -n uploaded_file -p Content-Type=text/html > results.html && firefox results.html – Nona Urbiz Oct 16 '10 at 22:01