最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Screen scraping through AJAX and javascript - Stack Overflow

programmeradmin6浏览0评论

I want to scrape a screen using AJAX and javascript. How is this possible?

Need to scrape this : ;clienttype=dot&cntry_code=us&language=english&tracknumbers=776812461212825

I had used the technique given in w3school, but it's showing "access denied." Why is the "access denied" showing? Please solve my problem..

Thanks in advance.

I want to scrape a screen using AJAX and javascript. How is this possible?

Need to scrape this : http://www.fedex./Tracking?ascend_header=1&clienttype=dot&cntry_code=us&language=english&tracknumbers=776812461212825

I had used the technique given in w3school., but it's showing "access denied." Why is the "access denied" showing? Please solve my problem..

Thanks in advance.

Share Improve this question edited Jan 7, 2009 at 7:29 John Goering 39.1k59 gold badges163 silver badges246 bronze badges asked Jan 7, 2009 at 7:15 praveenjayapalpraveenjayapal 38.6k31 gold badges74 silver badges74 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

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.

Check out this information on creating proxies.

Building on Beau Simensen answer, you could make an Ajax call to your own domain:

Ajax.Request("http://mydomain./proxy.php?url=http://www.fedex./Tracking?ascend_header=1&clienttype=dot&cntry_code=us&language=english&tracknumbers=776812461212825");

The proxy.php file would just make a CURL request (or something else) to the url parameter provided and return its result, this way you can access all sites on your local domain through that proxy.php.

Ajax/XMLHttpRequest calls are restricted to a same-site policy for security reasons; you can't use them to directly load remote sites. Firefox 3.1 apparently added support for cross-site requests, but I haven't heard if any other browsers jumped.

发布评论

评论列表(0)

  1. 暂无评论