2

Watin を使用して html スナップショットを取得し、Google の仕様に従って単一ページの ajax アプリをクロール可能にしたいと考えています。

Watin を使用して html スナップショットを googlebot に返す方法のコード例を教えてください。

これは私がこれまでに持っているものですが、正直なところ、これでどこに行くのかさえわかりません。実際にそれを明確にするWeb上の単一の例を実際に見つけていません。

コントローラ:

    public PartialViewResult Solutions()
    {
        //Googlebot request
        HtmlString htmlSnapshot = (HtmlString)GetHtmlSnapshot(Request.Path);
        //return ?????????

        //Normal user request
        return PartialView("Solutions", null);
    }
    public PartialViewResult MarketData()
    {
        return PartialView("MarketData", null);
    }

    public IHtmlString GetHtmlSnapshot(string uglyUrl)
    {
        if (uglyUrl.Contains("?_escaped_fragment_="))
        {
            string prettyUrl = uglyUrl.Replace("?_escaped_fragment=", "");
            string decodedUrl = HttpUtility.UrlDecode(prettyUrl);

            FireFox firefox = new FireFox();
            firefox.GoTo(decodedUrl);

            //?????????                
        }            
    }
4

0 に答える 0