0

How include in my php a div from other web ?

For example : http://www.laselvadelcamp.org/estacio-meteorologica

Only want show this <div id="content-inner-inner" class="content-inner-inner inner"> in my php. ??

I tried :

Get DIV content from external Website

But I get incorrect data and without styles.

Community
  • 1
  • 1
Calimbero
  • 31
  • 1
  • 4
  • Please be much more specific in your question. What do you exactly mean by "I get incorrect data" and explain why you would expect to get a specific styling in such a case. Consider that you did not post _any_ of your code, so how do you expect us to answer with anything specific? – arkascha Mar 31 '16 at 12:33
  • If you tried something, then put the exact code that you used in your question, explain the (undesired) results, and explain exactly what you wanted it to do. Obviously if you are not including any of the stylesheets from the remote site, then those styles will not magically be applied on your site. – Patrick Q Mar 31 '16 at 12:33
  • I can't give you an answer as I'm typing on my phone. But, I would do a file_get_contents and then parse it with Strpos. Should only be about 3-4 lines of code. – Andreas Mar 31 '16 at 12:35
  • To correct retrieve part of HTML you need a Parser. In your linked question, take a look at [this answer](http://stackoverflow.com/a/20447057/3294262). To retrieve styles, you have to retrieve also stylesheets with the risk of conflicts with your own stylesheet (there are more than 30 stylesheets on loaded page). As alternative, you can build your own style for imported `
    `
    – fusion3k Mar 31 '16 at 12:42
  • For example this image tell about my problem : http://stackoverflow.com/questions/9453780/ios-webview-display-only-main-content-from-a-website-including-pictures , Only want show a div specific in my page, I don't know if is possible – Calimbero Mar 31 '16 at 12:42

0 Answers0