webrequest问题 [英] Problem with webrequest

查看:74
本文介绍了webrequest问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用webrequest从以下站点获取评论.内容即将发布,但没有评论显示.是什么问题?

public static string FetchWebpageSourceContent()
        {
            try
             {
         string _path ="http://www.walmart.com/catalog/allReviews.do?product_id=6457603";             
var req = HttpWebRequest.Create(_path);
                var response = req.GetResponse();

                return new System.IO.StreamReader(response.GetResponseStream()).ReadToEnd();
            }
            catch (Exception ex)
            {
                return String.Empty;
            }
        }

推荐答案

评论是由某些客户端脚本发出的,因此在响应字符串中,您会得到一些未编译的Jquery-js内容. >
下面的jQuery函数正在获取评论

The reviews are coming by some client side script so in response string you are getting some un-compiled Jquery-js content.

the below jquery function is fetching the reviews


BV.ui("rr", "show_reviews", { productId: " 6457603", contentContainerDiv: "BVReviewsContainer", summaryContainerDiv: "BVCustomerRatings", secondarySummaryContainerDiv: "BVSecondaryCustomerRatings", mediaGalleryContainerDiv: "BVMediaGalleryContainer", sort: "helpfulness", dir: "desc" });
BV.ui("rr", "show_reviews", { productId: " 6457603", contentContainerDiv: "BVReviewsContainer", summaryContainerDiv: "BVCustomerRatings", secondarySummaryContainerDiv: "BVSecondaryCustomerRatings", mediaGalleryContainerDiv: "BVMediaGalleryContainer", sort: "helpfulness", dir: "desc" });



因此您看不到评论.

希望这会有所帮助!!!

此致
瑞沙(Reishabh)



So you are not able to see the review comments.

Hope this helps !!!

Regards,
Reishabh


这篇关于webrequest问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆