tags:

views:

24

answers:

1

Hi there

I wanna list a external webpage's ulr's content. like i wanna list the content of this website example.com/dir/dir/images/

currently i can download an image from a page with urllib.urlretrieve(page_url,save_url )

But I want to list all images in a directory, or anything ells for that matter

I wanna use python

+2  A: 

Unfortunately this can only work if the web server in question will serve you a directory listing when you navigate to that directory's URI.

If it does, typical directory listings have very simple markup, making them a prime candidate for various forms of web scraping. Otherwise, you're out of luck.

Nick
so if the web server does in fact allow this, how would i do that?
Harry
this will depend largely on the structure and formatting of your directory listing, but for your typical apache directory listing, finding each of the links on the page would be a good start. Have a google around for Web Scraping and Regular Expressions.
Nick