列出网址目录内容
我想列出外部网页的 url 内容。就像我想列出这个网站的内容 example.com/dir/dir/images/
目前我可以从页面下载图像:
urllib.urlretrieve(page_url,save_url )
但我想列出目录中的所有图像或任何内容就此事而言,
我想使用 python
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是,只有当您导航到该目录的 URI 时,相关 Web 服务器将为您提供目录列表,这才有效。
如果是这样,典型的目录列表具有非常简单的标记,使它们成为各种形式的网络抓取的主要候选者。否则,你就不走运了。
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.