| Author |
help with #2 |
SwartMumba
Member

Posts: 292
Location: TX <--- I'm here
Joined: 18.09.07 Rank: Uber Elite |
|
I have just started learning python and I need some help. I have the answer but I do not know how to submit it.
Is this the right path to go:
req = urllib2.Request(url,Answer,dicHeaders)
Edited by SwartMumba on 17-10-07 10:40 |
|
| Author |
RE: help with #2 |
mitz247
Member

Posts: 246
Location: far far away
Joined: 13.05.07 Rank: God Warn Level: 5
|
|
|
req = urllib2.Request('url',values)
|
|
| Author |
RE: help with #2 |
spyware
Member

Posts: 4158
Location: The Netherlands
Joined: 14.04.07 Rank: God Warn Level: 90
|
|
|
req = urllib2.Request('url', values)
@Mitz You forgot a space.
And yes; it's important.
The most censored HBH profile.

"The chowner of property." - Zeph“Widespread intellectual and moral docility may be convenient for leaders in the short term,
but it is suicidal for nations in the long term.” - Carl Sagan “Since the grid is inescapable, what were the earlier lasers about? Does the corridor have a sense of humor?” - Ebert |
|
| Author |
RE: help with #2 |
stdio
Member
Posts: 375
Location: omnipresent
Joined: 06.04.08 Rank: God |
|
I might as well bump this as I'm in the exact same place now.
This is my current failure
values = urllib.urlencode ({'ans' : total,
'submit' : 'Check',
})
req = urllib2.Request(url, values)
response = urllib2.urlopen(req)
And with that Im getting a malformed request asking me to make sure no referer spoofing applications are active
I'm sorry, I cant hear you over the sound of how awesome I am! |
|
| Author |
RE: help with #2 |
SwartMumba
Member

Posts: 292
Location: TX <--- I'm here
Joined: 18.09.07 Rank: Uber Elite |
|
|
stdio wrote:
And with that Im getting a malformed request asking me to make sure no referer spoofing applications are active
That is because you are not including a referer in your header of your request.
Other than that, why don't you use the opener that I showed you how to build?
Build it then:
resp = opener.open("http://www.hellboundhackers.org/challenges/timed/timed2/index.php?check", data)
Where data is your urlencoded data (ans, submit).
Edited by SwartMumba on 21-04-08 01:25 |
|
| Author |
RE: help with #2 |
stdio
Member
Posts: 375
Location: omnipresent
Joined: 06.04.08 Rank: God |
|
Thanks I actually was trying that first, but for some reason couldnt get it to work, so turned here and was using the older way.
Hopefully with a few modifications then I can get it working.
Edit: yeah I looked at my original attempt and was missing 2 things, both trivial and stupid. Thanks again for the help.
I'm sorry, I cant hear you over the sound of how awesome I am!
Edited by stdio on 21-04-08 01:33 |
|