为了上传一个在http://pythonscraping.com/files/form2.html文件。用PYTHON自动实现上传
import requests files = {‘uploadFile‘: open(‘..\chapter5\IMG_20181002_095110.jpg‘, ‘rb‘)} r = requests.post(‘http://pythonscraping.com/pages/files/processing2.php‘, files=files) print(r.text)
IMG_20181002_095110.jpg是和程序在同一个..\chapter5下,摸索了半天
原文:https://www.cnblogs.com/luckyzt/p/11879297.html