HTML manipulation with PHP / JS

0

How to get content from a page with JavaScript ?

With the content obtained through JavaScript (or PHP), how to manipulate it in both languages, in order to read the values, just like we do in JavaScript when we are manipulating DOM elements.

What do I want to do?

Capturing values from a sequence of 50 URLS (50 pages), which follow the same formatting pattern, as the site that wants to accomplish such an exploit does not provide an API to return the data in an easy-to-manipulate format returning the data in XML or JSON), I think the only way would be to get the data with cURL or file_get_contents, and manipulating all this HTML text, the main question is how to manipulate HTML formatted text with PHP .

I mentioned how to manipulate with Javascript a text (that could have been obtained with iframe for example) just to take advantage of the scope of the question and to solve this other doubt.

    
asked by anonymous 17.10.2015 / 03:22

1 answer

2

A simple and functional examples of how to get the html of a page as well as retrieve certain value from within this html can be found here: link

But I make the words of our comrade Marcelo mine.

Only perform this type of action on the back end if it is really necessary, ie last resort.

    
17.10.2015 / 06:16