如何创建站点地图/列表
我需要创建站点地图/列表,但我还需要显示链接名称。
我的意思是,比如说,www.google.com,我需要创建以下列表。
Google - www.google.com
Images - http://images.google.com/imghp?hl=en&tab=wi
...
My Account - http://images.google.com/imghp?hl=en&tab=wi
Personal Information Edit - https://www.google.com/accounts/EditUserInfo
...
My Products - https://www.google.com/accounts/EditServices
...
Privacy - http://www.google.com/intl/en/privacy.html
...
该列表需要绑定到一个域,例如 us.example.com。
我尝试使用 python 脚本进行深度优先搜索,并使用 Beautiful Soup 来解析链接。 这是不成功的。
有人对如何做到这一点有任何想法吗?
I need to create a site map/list, but I need the link-name to show up as well.
What I mean by that is given, say, www.google.com, I need the following list to be created.
Google - www.google.com
Images - http://images.google.com/imghp?hl=en&tab=wi
...
My Account - http://images.google.com/imghp?hl=en&tab=wi
Personal Information Edit - https://www.google.com/accounts/EditUserInfo
...
My Products - https://www.google.com/accounts/EditServices
...
Privacy - http://www.google.com/intl/en/privacy.html
...
The list needs to be bound to a domain, say us.example.com.
I have tried a depth first search using a python script, with Beautiful Soup to parse the links. This was unsuccessful.
Anybody have any ideas on how they would do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一个非常简单的站点地图可以是一个名为的文件
如果您需要“抓取”自己的网站以获取所有链接,您可能以错误的方式设置了您的网站:(
在大多数语言中,您可以尝试文件/方向迭代,如果您的使用数据库应该会更容易,因为您可以通过稍微调整创建网址的方式来一次重现所有链接以输出 sitemap.txt (或者如果您有超过 50 / 100 个网址,您可能想要生成XML)
如果您需要创建文件迭代器的帮助,您可能需要提供更多关于哪种语言最适合您的信息,因为如果您用 python 编写所有内容,那么一个不错的 PHP 解决方案可能根本没有帮助。
A very simple sitemap can be a file called
If you need to 'scrape' your own website for all your links you probably have setup your website in a wrong way :(
In most languages you could try either a file / direction iteration, if your using a database it should be even easier as you can just reproduce all the links at once by tweaking the way you create urls just a bit to output a sitemap.txt (or if you have more then 50 / 100 urls you might want to generate an XML)
If you need help with creating a file iterator you might want to give some more information about which language would suite you best, as a decent PHP solution might not help at all if your writing everything in python.
如果您正在寻找自动 Web 服务来为您创建站点地图,您可以使用以下一些服务:
您也可以在这里找到服务列表:
https://code.google.com/p/sitemap-generators/wiki/SitemapGenerators祝
你好运!
If you're looking for an automated web service to create the sitemap for you, you can use some of the following:
You can find a list of services here too:
https://code.google.com/p/sitemap-generators/wiki/SitemapGenerators
Good luck!
[来源:如何在 5 分钟内创建 Google 站点地图]
[Source: How To Create a Google Sitemap in 5 Minutes]