Reading site pages

Let's say there is a website called http://example.com/a

the website is being developed using PHP, Perl, Ruby and other languages.

I want to be able from my site to be able to read these website pages, execute the code and then parse the HTML results page tags and get the content using PHP.

it's like reading news from some news websites and then displaying it on my website in a different format or style.

+2


source to share


1 answer


I'm not sure if you understand this aspect of web programming, but you cannot access the server-side code that generated the HTML. You can of course parse the HTML that is returned from the server using one of the HTML parsers .



This may or may not be what you asked because your question is a little vague to me. Please note that if you want to collect information from other web pages on your web page, you must ensure that your website does not make a request for other web pages every time a user visits your site. (Ugh, that was a few!) You need to implement some kind of caching of the content of other websites.

+4


source







All Articles