views:

65

answers:

1

I need to retrieve my info from Stack Overflow. The web page that I want to retrieve is something like this.

http://stackoverflow.com/users/260127/prosseek 

When I run the script, it doesn't seem return any results.

import urllib                                       
sock = urllib.urlopen("http://stackoverflow.com/users/260127/prosseek") 
htmlSource = sock.read()                            
sock.close()                                        
print htmlSource

whereas I get almost instant result with this.

import urllib                                       
sock = urllib.urlopen("http://diveintopython.org/") 
htmlSource = sock.read()                            
sock.close()                                        
print htmlSource

What might be wrong?

PS. I don't know wether this should be asked at MetaStackOverflow or not.

+1  A: 

It "works" for me - the page returned is a 404 error. Try putting the URL http://stackoverflow.com/users/XXXXX/prosseek into your browser and see for yourself.

I think you want to use http://stackoverflow.com/users/260127/prosseek instead.

Matt Ball
The XXXXX was 260127, and I just wanted to show some example.BTW, I used TextMate, and use it to run python to fail. Using command line works well. Thanks,
prosseek