Seite 1 von 1
Urllib Post Elemente übergeben
Verfasst: Freitag 4. Dezember 2009, 16:32
von Bob13
Moin!
Ich möchte mit der URLLIB aus Python 3.1 Post Elemente an eine Website übergeben.
Aus der Dokumentation
http://docs.python.org/3.1/library/urllib.request.html
werd ich nicht ganz schlau:roll:...
Kann mir jemand ein Beispiel geben?
Verfasst: Freitag 4. Dezember 2009, 17:51
von Defnull
Es steht doch genau im text, wie das geht:
http://docs.python.org/3.1/library/urll ... st.urlopen
Oder hapert es am Englisch?
Verfasst: Freitag 4. Dezember 2009, 19:03
von Bob13
data may be a string specifying additional data to send to the server, or None if no such data is needed. Currently HTTP requests are the only ones that use data; the HTTP request will be a POST instead of a GET when the data parameter is provided. data should be a buffer in the standard application/x-www-form-urlencoded format. The urllib.parse.urlencode() function takes a mapping or sequence of 2-tuples and returns a string in this format.
Ich versteh schon den Sinn des Textes, aber wie übergeb ich z.B. user=xyz und pw=abc an die Site, also was muss in dem DATA String stehen?
Verfasst: Freitag 4. Dezember 2009, 19:12
von Dav1d
Verfasst: Freitag 4. Dezember 2009, 19:13
von Bob13
VIELEN DANK!
