Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 700987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:33:34+00:00 2026-05-14T03:33:34+00:00

Is it possible to fetch pages with urllib2 through a SOCKS proxy on a

  • 0

Is it possible to fetch pages with urllib2 through a SOCKS proxy on a one socks server per opener basic? I’ve seen the solution using setdefaultproxy method, but I need to have different socks in different openers.

So there is SocksiPy library, which works great, but it has to be used this way:

import socks
import socket
socket.socket = socks.socksocket
import urllib2
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "x.x.x.x", y)

That is, it sets the same proxy for ALL urllib2 requests. How can I have different proxies for different openers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:33:34+00:00Added an answer on May 14, 2026 at 3:33 am

    Try with pycurl:

    import pycurl
    c1 = pycurl.Curl()
    c1.setopt(pycurl.URL, 'http://www.google.com')
    c1.setopt(pycurl.PROXY, 'localhost')
    c1.setopt(pycurl.PROXYPORT, 8080)
    c1.setopt(pycurl.PROXYTYPE, pycurl.PROXYTYPE_SOCKS5)
    
    c2 = pycurl.Curl()
    c2.setopt(pycurl.URL, 'http://www.yahoo.com')
    c2.setopt(pycurl.PROXY, 'localhost')
    c2.setopt(pycurl.PROXYPORT, 8081)
    c2.setopt(pycurl.PROXYTYPE, pycurl.PROXYTYPE_SOCKS5)
    
    c1.perform() 
    c2.perform() 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to fetch the first few, say 1K, of a webpage using
My application often fetch data from a webpage using WebRequest, but it isn't possible
Possible Duplicate: How do I make a request using HTTP basic authentication with PHP
Is it possible to fetch Page results when using Spring Data Graph (Neo4J) as
Possible Duplicate: How can one check to see if a remote file exists using
Possible Duplicate: Fetch data in database table insert it if not exist else return
Is it possible to fetch all the ringtones from the phone and show it
Is that possible to fetch only a number of bytes from some URL and
Is it possible to fetch the values selected in Java Applet and pass the
I have two pages: categories.php in categories.php page I fetch all categories. news.php in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.