Hi all,

I'm trying to use Python's urllib to get a Facebook profile page. I get the following error:

IOError: [Errno socket error] [Errno 10035] A non-blocking socket operation could not be completed immediately

Here's my code:

import urllib
member_profile_text = urllib.urlopen('http://www.facebook.com/profile.php?id=1073109649').read()

I need to get this working soon, so any help would be extremely appreciated.

Thanks so much!
Benjamin

Recommended Answers

All 8 Replies

Depending on the page you probably need to login to fb first before you can access that page.

commented: Thanks for the help! +2

Works fine for me using Python27 on Windows7 OS.

commented: Thanks for the help! +2

@ Vegaseat
That's really odd, it fails with the same error every time for me. I'm running Python 2.7 on Windows Vista. Also, I have a good internet connection.

@ predator78
I appreciate your response! It was a good idea. Unfortunately, it's not working for me.

Thanks for the responses so far!
Benjamin

It works for me on Slackware Linux as well. Are you behind a firewall?

commented: Thanks for the help! +2

Some security setting in Windows Vista could be the problem?

Some security setting in Windows Vista could be the problem?

I doubt it, I've used this library before on same machine with same settings and met with success, I just can't figure out what's different here. Also, I can't find anything with my security system that would be blocking it....

I just ran the code in the IDLE and it worked just fine. No errors.
I am running Windows Vista, and I used Python 2.7.1

- WolfShield

commented: Thanks for the help! +2

I just ran the code in the IDLE and it worked just fine. No errors.
I am running Windows Vista, and I used Python 2.7.1

- WolfShield

Alright, I have confirmation. I'll stop checking my code and start on my firewall. Thanks for all your help people, WolfShield, Vegaseat, wooee, predator78. I really appreciate it.

Cheers!
Benjamin

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.