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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:35:41+00:00 2026-06-03T21:35:41+00:00

I need to scrape a website that has a basic folder system, with folders

  • 0

I need to scrape a website that has a basic folder system, with folders labled with keywords – some of the folders contain text files. I need to scan all the pages (folders) and check the links to new folders, record keywords and files. My main problem ise more abstract: if there is a directory with nested folders and unknown “depth”, what is the most pythonc way to iterate through all of them. [if the “depth” would be known, it would be a really simple for loop). Ideas greatly appriciated.

  • 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-06-03T21:35:43+00:00Added an answer on June 3, 2026 at 9:35 pm

    Here’s a simple spider algorithm. It uses a deque for documents to be processed and a set of already processed documents:

    active = deque()
    seen = set()
    
    active.append(first document)
    
    while active is not empty:
        document = active.popleft()
        if document in seen:
            continue
    
        # do stuff with the document -- e.g. index keywords
    
        seen.add(document)
        for each link in the document:
             active.append(link)
    

    Note that this is iterative and as such can work with arbitrary deep trees.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to scrape some data from a page that doesn't belong to my
I need to scrape from a website that requires authentication, that is a user
I need to scrape a web page that has a javascript array embeded in
I need to scrape some website data from a table on a website and
Need to insert selected text on the page into textarea. There must be some
I would like to scrape some dynamic data off of a website. On the
I'm using PHP to data scrape another website. However, on certain occasions I need
I need advice. I inherited a website that's been around a long time. The
I am using scrapy tool to scrape content from website, i need help from
I have a task where I need to autologin and scrape a particualr website.

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.