列出网址目录内容

发布于 2024-09-13 08:09:33 字数 218 浏览 1 评论 0原文

我想列出外部网页的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

同展鸳鸯锦 2024-09-20 08:09:33

不幸的是,只有当您导航到该目录的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文