如何从aspx wepage中捕获或重现动态数据? [英] how to capture or reproduce dynamic data from a aspx wepage ?

查看:83
本文介绍了如何从aspx wepage中捕获或重现动态数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在尝试在博客中建立一个页面,我希望从另一个aspx网页中放入一些动态数据,最好是在iframe中任何FTP或SQL服务器等。有没有办法复制和嵌入我的博客页面,如HTML代码



来获取谷歌电子表格中的动态数据?



是否有任何代码或程序可以将动态数据从Excel工作表导出到Google电子表格?我试图将动态数据从excel工作表导出到电子表格,但它变成了静态表............而不是DYNAMIC。



感谢

Hi,

I am trying to build-up a page in a blog where I wish to put some dynamic data from another aspx webpage preferably in an iframe without any FTP or SQL server, etc. Is there any way to copy and embed in my blog-page like html code
OR
to get those dynamic data in a google spreadsheet?

Is there any code or procedure to export dynamic data from excel worksheet to Google spreadsheet? I have tried to export dynamic data from excel worksheet to spreadsheet but it turns into a static sheet............ and not DYNAMIC.

Thanks

推荐答案

如果要从其他站点动态获取内容并在自己的站点中显示其中的一部分,可以尝试各种SiteScraping技术。一个简单的问题涉及HtmlAgilityPack,它下载目标网页并提取特定部分(将HTML作为XML文档)。然后你可以在你自己的页面上获取该部分。

通过在页面加载上使用这种方法,每次都会从目标站点获取此方法。或者你可以设置一些滑动到期的缓存来限制目标命中(只是为了保存性能)



至于在谷歌电子表格应用程序中设置数据,你需要检查Google API文档,无关.net
If you want to dynamically pick up content from another site and display part of it in your own site, you can try various SiteScraping techniques. A simple one involves HtmlAgilityPack which downloads the target webpage and extracts a specific section (taking HTML to be an XML document). Then you can take that section on your own page.
By having such method on your page load, this will be fetched everytime from the target site. Or you can setup some caching with sliding expiration to have limited hits to target (just to save performance)

As for setting data in google spreadsheet application, you need to check Google API documentation, that's nothing about .net


您好b $ b

假设您只想更新代码项目配置文件。在_codeProjectProfile中复制个人资料的网址,然后运行以下代码。这也需要你的配置文件中显示的CSS,以确保它看起来格式正确。



在这样的代码中,你只需要将html作为xml结构和将想要的块标识为XmlNode。目的是获得所需节点的XPath :)



如果这个用于您的目的,请按答案投票。



Hi
Suppose you just want to take updates of your Code Project profile. Copy the Url of your profile in "_codeProjectProfile" and run the code below. This also takes the CSS as shown in your profile to make sure it appears correctly formatted.

In such codes, you just have to take the html as an xml structure and identify the wanted blocks as XmlNode. The purpose is to get the XPath of your desired node :)

If this serves for your purpose, please vote as answered.

            var webGet = new HtmlWeb();
            var document = webGet.Load(_codeProjectProfile);

            // Get the stylesheets involved
            var stylesheets = document.DocumentNode.SelectNodes("@//link[@rel='stylesheet']");
            List<string> cssFiles = new List<string>();
            foreach (var style in stylesheets)
            {
                cssFiles.Add(style.Attributes["href"].Value);
            }
            var wantedNode = document.DocumentNode.SelectSingleNode("//table[@class='member-profile']");
            if (null != wantedNode)
            {
                cssFiles.ForEach(css =>
                    {
                    string script = "<link rel="\"stylesheet\"" type="\"text/css\"" href="\""+css" />";
                        Page.Header.Controls.Add(new LiteralControl(script));
                    });
                divSiteCodeProject.InnerHtml = wantedNode.OuterHtml;
            }
</string></string>


您好Nitin Singh,



对不起,我要说我试过但由于我的无知,我无法得到它。

你能否详细说明这个过程,请。 ?



我的邮件ID是:jksarkar2009@gmail.com



提前致谢
Hi Nitin Singh,

I am sorry but to say that I have tried but due to my ignorance, I am not able to get it.
Can you elaborate the process, pls. ?

My mail id is : jksarkar2009@gmail.com

Thanks in advance


这篇关于如何从aspx wepage中捕获或重现动态数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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