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

  • Home
  • SEARCH
  • 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 4337280
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:55:21+00:00 2026-05-21T10:55:21+00:00

Suppose I want to bruteforce webpages: for example, http://www.example.com/index.php?id= <1 – 99999> and search

  • 0

Suppose I want to bruteforce webpages:

for example, http://www.example.com/index.php?id=<1 – 99999>
and search each page to find if there contain a certain text.
If the page contains the text, then store it into a string

I kind of get it working in python, but it is quite slow (around 1-2 second per page, which would take around 24 hours to do that) is there a better solution? I am thinking of using C/C++, because I heard python is not very efficient. However, after a second thought, I think it might not be the efficiency of python, but rather the efficiency of accessing html element (I changed the whole html into a text, then search it… and the content is quite long)

So how can I improve the speed of bruteforcing?

  • 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-21T10:55:22+00:00Added an answer on May 21, 2026 at 10:55 am

    Most likely your problem has nothing to do with your ability to quickly parse HTML and everything to do with the latency of page retrieval and blocking on sequential tasks.

    1-2 seconds is a reasonable amount of time to retrieve a page. You should be able to find text on the page orders of magnitude faster. However, if you are processing pages one at a time you are blocked waiting for a response from a web server while you could be finding your results. You could instead retrieve multiple pages at once via worker processes and wait only for their output.

    The following code has been modified from Python’s multiprocessing docs to fit your problem a little more closely.

    import urllib
    from multiprocessing import Process, Queue
    
    def worker(input, output):
      for func, args in iter(input.get, 'STOP'):
        result = func(*args)
        output.put(result)
    
    def find_on_page(num):
      uri = 'http://www.example.com/index.php?id=%d' % num
      f = urllib.urlopen(uri)
      data = f.read()
      f.close()
      index = data.find('datahere:') # obviously use your own methods
      if index < 0:
        return None
      else:
        return data[index:index+20]
    
    def main():
      NUM_PROCESSES = 4
      tasks = [(find_on_page, (i,)) for i in range(99999)]
      task_queue = Queue()
      done_queue = Queue()
      for task in tasks:
        task_queue.put(task)
      for i in range(NUM_PROCESSES):
        Process(target=worker, args=(task_queue, done_queue)).start()
      for i in range(99999):
        print done_queue.get()
      for i in range(NUM_PROCESSES):
        task_queue.put('STOP')
    
    if __name__ == "__main__":
      main()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I want to execute code, for example value += 5 inside a namespace
Suppose I am watching something in VS2008 and I want to search the object
Suppose I want to get all text of each li and save it into
Suppose I want to define an enum pointing to an array of objects. Can
Suppose I want to implement a curses/console like program in HTML/CSS/Javascript. Examples might be
Suppose I want to open a file in an existing Emacs session using su
Suppose I want to implement a reasonably efficient 'keyword recognition algorithm', that is first
Suppose you want to make an async request in JavaScript, but you want to
Suppose I want to create a set of observers based on type. That is
Suppose I want to count the lines of code in a project. If all

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.