Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
コード:
import urllib,urllib2 url = 'http://www.pythonchallenge.com/pc/def/linkedlist.php' print urllib2.urlopen(url).read() print urllib2.urlopen(url,urllib.urlencode({'nothing':12345})).read()
私が遭遇する質問は、2つの「印刷」が同じコンテンツを出力する理由です。私のコードのどこに問題がありますか?
urlopenの2番目の引数は、POSTされるデータです。URL引数が必要な場合は、URLを作成する必要があります。
print urllib2.urlopen("%s?%s" % (url,urllib.urlencode({'nothing':12345}))).read()