#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    Atlantic City, NJ
    Posts
    327
    Rep Power
    13

    Remote Directory Listing?


    Is it possible to get a listing of all the files in a web server directory? For instance:

    http://gentoo.seren.com/gentoo/releases/ppc64/current/installcd/

    has 6 files available. Is there an easy way to get the files available in a remote directory? Something like:

    os.listdir('url')

    ??? Of course that doesn't work but I think you know what I'm talking about.

    I could get the page html code and parse it for the file names but that seems like a bit too much. Anybody know of a method that does this?
    I'll learn this stuff someday.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2004
    Posts
    461
    Rep Power
    25
    i think parsing the html will be the only way, since that is how the http protocal works. That page is generated by the server into html and is suppose to look like a directory, so you can browse through it like one. However it is still html and has to be used that way.

    you could however connect to a ftp server and get directory listings with it. Use the ftpLib module to do something like that.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Location
    Atlantic City, NJ
    Posts
    327
    Rep Power
    13
    Originally Posted by CyBerHigh
    i think parsing the html will be the only way, since that is how the http protocal works. That page is generated by the server into html and is suppose to look like a directory, so you can browse through it like one. However it is still html and has to be used that way.

    you could however connect to a ftp server and get directory listings with it. Use the ftpLib module to do something like that.
    Thats what I figured. Thanks.
    I'll learn this stuff someday.

IMN logo majestic logo threadwatch logo seochat tools logo