gpt4 book ai didi

seo - 我的带有特殊参数的网址无法在谷歌中获取和索引,我有爬虫错误

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:49:43 25 4
gpt4 key购买 nike

我的带有特殊参数的 URL 无法在 google 中获取和编制索引,并且对于所有包含此参数“#!”的 URL,我都遇到爬虫错误

mysite.com/products/دوربین/1187/view/#!/productgroup-1187/attributes-576644-2207/

并且在谷歌中获取只支持这个:/products/دوربین/1187/view/表示在包含“#!”的 URL 之后并且 google fetch 在
之后没有显示或知道另一个章程/products/دوربین/1187/view/

此参数用于排序和过滤在 google URL 参数中,将参数显示为“_escaped_fragment_”,我将其更改为如下图

爬虫错误网址:mysite.com/products/%DA%AF%D9%88%D8%B4%DB%8C/1145/view/?_escaped_fragment_=/productgroup-1145/attributes -100686-2305/

enter image description here

最佳答案

我认为您可以使用这样的网站对这些字符进行编码:http://www.url-encode-decode.com例如:

mysite.com/products/دوربین/1187/view/#!/productgroup-1187/attributes-576644-2207

变成:

mysite.com%2Fproducts%2F%D8%AF%D9%88%D8%B1%D8%A8%DB%8C%D9%86%2F1187%2Fview%2F%23%21%2Fproductgroup-1187%2Fattributes-576644-2207

根据您使用的语言,有一些库函数可以帮助您以编程方式实现这种翻译。

由于您使用的是 C#,因此您可以尝试使用 UriBuilder 类。这是一些演示代码:

using System;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
var oURL = new UriBuilder("mysite.com/products/دوربین/1187/view/#!/productgroup-1187/attributes-576644-2207");
string sEscapedURL = oURL.Uri.AbsoluteUri;

Console.WriteLine("sEscapedURL = {0}", sEscapedURL);
Console.ReadLine(); //Pause
}
}
}

关于seo - 我的带有特殊参数的网址无法在谷歌中获取和索引,我有爬虫错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41586809/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com