Python 使用urllib更改表的值

Python 使用urllib更改表的值,python,urllib,Python,Urllib,我正在尝试使用urllib更改表中的值。我相信这样做的方法是使用post请求。然而,我没有任何成功,完全迷失了方向 非常感谢您能提供的任何帮助 这是我试图编辑的页面(editme.php) 嗯。。。很抱歉,除非php脚本这样做,否则无法通过urllib更改该表的值。而editme.php是一个“纯”html文件 你的要求毫无意义。您必须更改模板或在服务器上呈现表的任何内容,而不是通过下载/上载 -1表示不知道客户端和服务器端之间的差异 <html> <body>

我正在尝试使用
urllib
更改表中的值。我相信这样做的方法是使用post请求。然而,我没有任何成功,完全迷失了方向

非常感谢您能提供的任何帮助

这是我试图编辑的页面(editme.php)


嗯。。。很抱歉,除非php脚本这样做,否则无法通过urllib更改该表的值。而editme.php是一个“纯”html文件

你的要求毫无意义。您必须更改模板或在服务器上呈现表的任何内容,而不是通过下载/上载

-1表示不知道客户端和服务器端之间的差异
<html>
<body>
    <div>
        <table>
            <tr>
                <td id="changme">1</td>
            </tr>
        </table>
    </div>
</body>
</html>
import urllib
import urllib2
from BeautifulSoup import BeautifulSoup

values = urllib.urlencode({'changeme' : 'i have changed'})
f = urllib.urlopen("http://localhost/editme.php",values)
readdata = urllib.urlopen("http://localhost/editme.php")
print  BeautifulSoup(readdata).prettify()