为什么我的代码在用C#.net捕获网站后有所不同 [英] why my code is different after capturing web site by C#.net

查看:74
本文介绍了为什么我的代码在用C#.net捕获网站后有所不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一张图片是原始网站,第二张图片是我收到的代码。我认为

它使用的是ajax,我该怎么做?

这是URL =

 http://www.digikala.com/Search/Category-Mobile-Phone/#/Category-Mobile/Category-Mobile-Phone/ 



< img width = 400px src =http://i61.tinypic.com/flelgm.jpg/>

< img width = 400px src =http://i60.tinypic.com/2ynqdzr.jpg/>

解决方案

是的,它可能使用ajax,这意味着它将是一个不同的调用到他们的服务器。如果您确实需要知道屏幕抓取方法,请使用一些开发人员工具并查看源并观察网络流量。



更好的是,联系制作网站的人,看看他们是否可以为你提供api。


你永远不会完全回答了我的问题。到目前为止,大多数真实的答案可以在我对问题的评论中找到,但这个答案是不完整的,因为1)你对问题的描述是不完整的; 2)你缺少一些基本的东西,但从你的帖子中很难看出是什么。所以,我只是建议看看我过去的答案:

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

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



见还有: http://en.wikipedia.org/wiki/Web_scraping [ ^ ]。



-SA

the first image is the original site and the second one is the code that i have received .i think
it is using ajax,how can i do that?
this is the URL=

http://www.digikala.com/Search/Category-Mobile-Phone/#/Category-Mobile/Category-Mobile-Phone/


<img width=400px src="http://i61.tinypic.com/flelgm.jpg" />
<img width=400px src="http://i60.tinypic.com/2ynqdzr.jpg" />

解决方案

Yes, it likely uses ajax which means it will be a different call to their servers. Use some developer tools and view the source and watch the network traffic if you really need to know how to screen scrape it.

Better yet, contact the people who make the site and see if they can provide you with an api.


You never fully answered my questions. So far, most "real" answer can be found in my comments to the question, but this "answer" is incomplete, because 1) your description of the problem is incomplete; 2) you are missing something fundamental, but from your posts it's hard to see what. So, I'll just advise to see my past answers:
get specific data from web page[^],
How to get the data from another site[^].

See also: http://en.wikipedia.org/wiki/Web_scraping[^].

—SA


这篇关于为什么我的代码在用C#.net捕获网站后有所不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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