#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    4
    Rep Power
    0

    Question Listting HTTP directories


    Hello all,
    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,

    dan
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69

    directory listings.


    Hey,

    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.

    Mark.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    4
    Rep Power
    0

    Re: directory listings.


    Originally posted by netytan
    Hey,

    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.

    Mark.

    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.
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69

    FTP


    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.

    Mark.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    4
    Rep Power
    0

    Re: FTP


    Originally posted by netytan
    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.

    Mark.
    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!

IMN logo majestic logo threadwatch logo seochat tools logo