从另一个网站网页获取数据 [英] get data from another website web page

查看:151
本文介绍了从另一个网站网页获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨小伙伴们



我想从其他网站网页获取数据,但该网页包含一个带分页的网格,当我从该网页获取数据时只给我1个索引数据。但我想得到所有页面的inedx数据,所以有没有办法从该网站获取数据或以任何方式更改pagindex(意味着点击另一页索引)



谢谢

解决方案

当然,你可以在服务器端做到这一点。当您使用ASP.NET时,所有.NET FCL都在您的服务中。在这种情况下,您需要使用类 System.Net.HttpWebRequest 。在一些简化的情况下,您可以使用类 System.Net.WebClient

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx [ ^ ],

http://msdn.microsoft.com/en-us/library/system.net .webclient.aspx [ ^ ]。



实际上,您尝试实现的目标需要使用 Web抓取的技术。请参阅:

http://en.wikipedia.org/wiki/Web_scraping [< a href =http://en.wikipedia.org/wiki/Web_scrapingtarget =_ blanktitle =New Window> ^ ]。



您可以在我过去的答案中找到更多详细信息:

从网页获取特定数据 [ ^ ],

如何从其他网站获取数据 [ ^ ]。



Please考虑到Marcus Kramer在对这个问题的评论中告诉你的内容。 :-)



祝你好运,

-SA


如果它是一个外部站点,那么你可以做到这一点的唯一方法是查看URL以查看是否可以通过这种方式传递页面索引,或以某种方式通过Web浏览器控件自动化模拟浏览的程序。

hi guys

I want to get data from another website web page, but that web page contain a grid with paging, when i get data from that page it only give me the 1 index data. but i want to get the all page inedx data so is there any way to get data from that site or any way to change the pagindex (means click on the another page index)

thanks

解决方案

Of course, you can do it on server side. As you use ASP.NET, all .NET FCL is at your service. In this case, you need to use the class System.Net.HttpWebRequest. In some simplified cases, you can use the class System.Net.WebClient:
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx[^].

Actually, what you try to achieve requires use of the techniques of Web scraping. Please see:
http://en.wikipedia.org/wiki/Web_scraping[^].

You can find further detail in my past answers:
get specific data from web page[^],
How to get the data from another site[^].

Please take into account what Marcus Kramer told you in hist comment to the question. :-)

Good luck,
—SA


The only way you can do that, if it''s an external site, is to look at the URL to see if you can pass the page index that way, or somehow automate a program that simulates browsing, via a web browser control.


这篇关于从另一个网站网页获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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