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 436919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:31:34+00:00 2026-05-12T20:31:34+00:00

Instead of just using urllib does anyone know of the most efficient package for

  • 0

Instead of just using urllib does anyone know of the most efficient package for fast, multithreaded downloading of URLs that can operate through http proxies? I know of a few such as Twisted, Scrapy, libcurl etc. but I don’t know enough about them to make a decision or even if they can use proxies.. Anyone know of the best one for my purposes? Thanks!

  • 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-12T20:31:35+00:00Added an answer on May 12, 2026 at 8:31 pm

    is’s simple to implement this in python.

    The urlopen() function works
    transparently with proxies which do
    not require authentication. In a Unix
    or Windows environment, set the
    http_proxy, ftp_proxy or gopher_proxy
    environment variables to a URL that
    identifies the proxy server before
    starting the Python interpreter

    # -*- coding: utf-8 -*-
    
    import sys
    from urllib import urlopen
    from BeautifulSoup import BeautifulSoup
    from Queue import Queue, Empty
    from threading import Thread
    
    visited = set()
    queue = Queue()
    
    def get_parser(host, root, charset):
    
        def parse():
            try:
                while True:
                    url = queue.get_nowait()
                    try:
                        content = urlopen(url).read().decode(charset)
                    except UnicodeDecodeError:
                        continue
                    for link in BeautifulSoup(content).findAll('a'):
                        try:
                            href = link['href']
                        except KeyError:
                            continue
                        if not href.startswith('http://'):
                            href = 'http://%s%s' % (host, href)
                        if not href.startswith('http://%s%s' % (host, root)):
                            continue
                        if href not in visited:
                            visited.add(href)
                            queue.put(href)
                            print href
            except Empty:
                pass
    
        return parse
    
    if __name__ == '__main__':
        host, root, charset = sys.argv[1:]
        parser = get_parser(host, root, charset)
        queue.put('http://%s%s' % (host, root))
        workers = []
        for i in range(5):
            worker = Thread(target=parser)
            worker.start()
            workers.append(worker)
        for worker in workers:
            worker.join()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At work I just started using Subversion with AnkhSVN instead of Visual Source Safe.
Instead it just opens the new frame, and when that one closes.. it not
Not that it is seriously burdensome to type :My_custom_foobar() instead of just :my_custom_foobar() but
How come every object appears to be marked new, instead of just objects that
In an Android activity....how do I do the following using just code instead of
I've been trying to chain Arel queries using scopes, instead of just using some
I'm looking to understand when to use a WCF services instead of just using
I have a Python script that loads a web page using urllib2.urlopen , does
Instead of just filling out the form in HTML it should also be possible
The following modify method somehow modifies the whole @x array instead of just simply

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.