如何创建站点地图/列表

发布于 2024-07-08 12:35:59 字数 598 浏览 11 评论 0原文

我需要创建站点地图/列表,但我还需要显示链接名称。

我的意思是,比如说,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 技术交流群。

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

发布评论

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

评论(3

ι不睡觉的鱼゛ 2024-07-15 12:35:59

一个非常简单的站点地图可以是一个名为的文件

sitemap.txt

http://website.com/index.php
http://website.com/about.php
http://website.com/blog.php

如果您需要“抓取”自己的网站以获取所有链接,您可能以错误的方式设置了您的网站:(

在大多数语言中,您可以尝试文件/方向迭代,如果您的使用数据库应该会更容易,因为您可以通过稍微调整创建网址的方式来一次重现所有链接以输出 sitemap.txt (或者如果您有超过 50 / 100 个网址,您可能想要生成XML)

如果您需要创建文件迭代器的帮助,您可能需要提供更多关于哪种语言最适合您的信息,因为如果您用 python 编写所有内容,那么一个不错的 PHP 解决方案可能根本没有帮助。

A very simple sitemap can be a file called

sitemap.txt

http://website.com/index.php
http://website.com/about.php
http://website.com/blog.php

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.

耳根太软 2024-07-15 12:35:59

如果您正在寻找自动 Web 服务来为您创建站点地图,您可以使用以下一些服务:

  1. http://www.web-site-map.com/xml_sitemap.php
  2. www.xml-sitemaps.com
  3. www.sitemapdoc.com

您也可以在这里找到服务列表:
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:

  1. http://www.web-site-map.com/xml_sitemap.php
  2. www.xml-sitemaps.com
  3. www.sitemapdoc.com

You can find a list of services here too:
https://code.google.com/p/sitemap-generators/wiki/SitemapGenerators

Good luck!

残月升风 2024-07-15 12:35:59
  1. 转到 XML 站点地图构建器
  2. 输入您网站的主页路径(例如 www.mydomain.com)
  3. 输入您网站的更改频率(老实说;)
  4. 其余部分保持原样,然后单击开始让该工具制作您的站点地图
  5. 完成后,下载压缩的 XML 站点地图版本 (.gz) 并将其复制到您的根文件夹。
  6. 您可以使用您选择的文本编辑器打开该文件,并更改您认为的文档的优先级。 您可以使用 0.1 到 0.9 之间的值,但请注意,只为真正重要的站点提供更高的值。
  7. 以下内容非常重要,以便所有搜索引擎机器人都知道您有站点地图。 创建一个名为

[来源:如何在 5 分钟内创建 Google 站点地图]

  1. Go to the XML Sitemap builder
  2. Enter the homepage path of your website (e.g. www.mydomain.com)
  3. Enter the change frequency of your website (be honest ;)
  4. Leave the rest as it is and click on start to let the tool make your sitemap
  5. When it is done download the compressed XML Sitemap version (.gz) and copy it to your root folder
  6. You can open the file with an text-editor of your choise and change the priority of documents you think. You can use and value between 0.1 and 0.9, but be aware to only give really important sites the higher value.
  7. The following is very important, so that all search engine bots will know you have a sitemap. Create a new file called

[Source: How To Create a Google Sitemap in 5 Minutes]

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