June 10th, 2003, 03:21 PM
Listting HTTP directories
I've looked, but I can't find a nice way to get a directory listing of an HTTP directory in Python (or anything for that matter!)
Can anyone help?
Thanks in anticipation,
June 10th, 2003, 05:43 PM
What exactly are you trying to do? To get a list of all the files and folders in a directory you can use os.listdirs(path string) which returns an array of all the files/folders it see's.
Also see the glob module.
Hope this helps.
June 10th, 2003, 05:55 PM
Re: directory listings.
Locally, getting a listing is easy. I want a listing of all files at, say, http://www.apple.com/
I could parse the HTML and get all the files it refers to, but that's not necessarily all the files in the directory.
June 10th, 2003, 06:25 PM
I'd check out the FTPlib module, this provides a full FTP interface, that should let you connect to a site and retieve a file/dir listing. If not maybe use the Socket module..
If you are just looking for a way to get the listing and done wnat to do much with it when you have the listing can i suggest the FlashGet Download Manager, it has a feature which allows you to conned to any website and get a list of all files and dirs.
June 10th, 2003, 06:30 PM
I can't FTP to all sites, i'd like to use HTTP if at all possible. One problem with FlashGet: i'm on Mac OS X
However, I'd love to know how flashget does it!