Go4Expert

Go4Expert (http://www.go4expert.com/)
-   JavaScript and AJAX (http://www.go4expert.com/forums/javascript/)
-   -   How to access the content of a webpage? (http://www.go4expert.com/forums/access-content-webpage-t19748/)

venami 12Oct2009 15:50

How to access the content of a webpage?
 
Hi all,

I was trying to get the contents from a dynamic webpage. In Javascript, I was able to access the Window object and access all the elements of the current webpage. Likewise, how can I access any other webpage and access its content?

My idea is to create a frame in my webpage and load the page(which I wanted to access), into that frame. Then I will have control over the elements of my target webpage and so can access the contents.

Is there a better/easy way to do it?

venami 15Nov2009 16:15

Re: How to access the content of a webpage?
 
To make my question clear, I need the PHP's "file_get_contents()" equivalent logic for JavaScript. I could not find any solution for my issue.

SaswatPadhi 15Nov2009 17:38

Re: How to access the content of a webpage?
 
I had to solve a very similar issue while preparing the G4EF toolbar.

Actually you may use XMLHttpRequest to get the page. [[ You can use it to transfer not only HTTP stream but also XML ]].
But I faced a lot of problem while accessing the DOM of the downloaded page. :(

So, I had to create a hidden frame and open the page within it.


All times are GMT +5.5. The time now is 21:11.