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

The Archive Base Latest Questions

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

I am actually using PHP but such crawling can be done by any programming

  • 0

I am actually using PHP but such crawling can be done by any programming languages. It will be a bit difficult to cater a lot of situations. Please help me look through the problem, and please give me some suggestion on whether I am going to the right direction.

What I know is the current url address from which I can get a list of links from <a href=" or from <frame src=".

What I am doing is: from current url address, I can firstly get root url, for example, from http://www.abc.com/def, I can get http://www.abc.com first. This is to cater the situation <a href="/fff.html", so I have to know the root url first.

Secondly, I need to get url directory from current url, this is a little difficult and I still have no idea how to get it done perfectly. For example, from http://www.abc.com/def/xyz.htm, it’s url directory is http://www.abc.com/def. This is to cater the situation <a href="../../xyz.html">.

The problem I am facing is, how to get the current url directory? For example, if the current url is http://www.abc.com/def, how can I actually know that def is a directory or a file? If def is a file, then the url directory would be http://www.abc.com. But if def is a directory, then the url directory would just be http://www.abc.com/def.

You can say that if there is “/” at last, then it would be directory. But from my point of view, when I am crawling a webpage, I can’t really ensure that the webpage builder will add “/” at the end of a directory url. A directory url is perfect valid, for example, if def is a directory, then http://www.abc.com/def would probably stands for http://www.abc.com/def/index.html.

Since it’s hard to know whether http://www.abc.com/def is a directory or a script file, then it is hard to make full url from relative href such as <a href="xyz.html">.

Am I over complicating the problem? Is there any solution to this?

There are other situations for example href=”# means anchor then I’ll just append it to the end of current url. Is that correct and valid for any current url situation? Meaning that, is that valid for the situation where current url is http://www.abc.com/def (def is a directory), will http://www.abc.com/def#xyz be converted to http://www.abc.com/def/index.html#xyz ?

And for href=”javascript: or href=”vbscript: etc, I’ll just ignore it.

And for href=”xyz.???”, and if ??? is an image file, exe file, or anything that is not valid html, I’ll just ignore them?

Thanks.

The question might be a little messy, I hope I explained it clearly.

  • 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-25T15:21:55+00:00Added an answer on May 25, 2026 at 3:21 pm

    Anything after the domain name can map to whatever the person configuring the domain wants.

    There is no guarantee that a URL ending in .html refers to a real file on a filesystem somewhere, or that it will return valid HTML, or anything else.

    You can arbitrarily decide to count def/ as a directory or part of a filename, whatever floats your boat, as any choice is equally correct.

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

Sidebar

Related Questions

Like many variables in PHP using ini_set() on a page doesn't actually work. I've
I am using prototype to load external js file (actually it is php file)
I'm new to Visual C# Studio (actually using the Express edition, but another developer
Actually I created a button using the cobogw widget library. But the button does
So, I have at site where I want pages such as; www.example.com/shop/index.php (or any
I'm going to use PHP in my example, but my question applies to any
I am actually using h:selectOneRadio to display items, given to it from f:selectItems tag.
How do I do the following SQL in LINQ? I am actually using LINQ
Actually i am using the AsyncCalls library to execute an Query asynchronously in this
Has anyone using .net actually worked out how to successfully sign a signature to

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.