我正在尝试使用this python脚本将文件上传到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
任何帮助将不胜感激!
修改
cyraxjoe指出我需要先通过php运行它。我尝试了这个,但结果相同:
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
答案 0 :(得分:1)
您正在上传一个php脚本,这是一个服务器端脚本,您需要在php处理后上传生成的html。也许使用php-cli然后将结果文本存储在文件中并上传该文件。