屏幕通过Ajax和JavaScript刮 [英] Screen scraping through AJAX and javascript
问题描述
我想用刮Ajax和JavaScript的屏幕。这怎么可能?
I want to scrape a screen using AJAX and javascript. How is this possible?
需要刮这样的: <一个href="http://www.fedex.com/Tracking?ascend_header=1&clienttype=dotcom&cntry_$c$c=us&language=english&tracknumbers=776812461212825" rel="nofollow">http://www.fedex.com/Tracking?ascend_header=1&clienttype=dotcom&cntry_$c$c=us&language=english&tracknumbers=776812461212825
Need to scrape this : http://www.fedex.com/Tracking?ascend_header=1&clienttype=dotcom&cntry_code=us&language=english&tracknumbers=776812461212825
我已经用在w3school.com给出的技术,但它显示拒绝访问。为什么是拒绝访问显示?请解决我的问题。
I had used the technique given in w3school.com, but it's showing "access denied." Why is the "access denied" showing? Please solve my problem..
在此先感谢。
推荐答案
如果你是屏幕抓取,试图直接从你的Javascript /网站访问联邦快递的URL在自己的领域,那就是你的问题。如果你真的要做到这一点,最简单的方法是使一个AJAX调用的脚本放在你的域名,并将它使跟踪请求你。
If you are screen scraping by trying to access the FedEx URL directly from your Javascript/website on your own domain, that is your problem. If you really want to do this, the easiest way would be to make an AJAX call to a script somewhere in your domain and have it make the tracking request for you.
这篇关于屏幕通过Ajax和JavaScript刮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!