Techniques or tools for including a snippet of one web page in another

Total Post:154

Points:1086
 1550  View(s)
Ratings:
Rate this:

It's common practice to include snippets of one page in another as an image of the rendered content. This has obvious disadvantages, not least that text isn't being represented as text.

Are there any techniques or tools that allow swift excerpting from one web page, and embedding of the excerpted content in another page?

I imagine the excerpting process would have to capture enough stylesheet data to recreate it, as well as work out how to trim down the content to just the area being captured.I imagine the embedding step may use the object element or something like that?

There must be a better way than capturing a rasterised rendering of the web page to be excerpted.

  1. Post:183

    Points:1285
    Re: Techniques or tools for including a snippet of one web page in another

    Hi Manoj!

    Yes, its possible. after you cURL the page (for example) into a variable, you will need to replace any relative paths with absolute (to the web root). You can achieve this with some regex.

      $domain = 'wwww.xyz.com';
    
       $result = 'Your html page data';
       $result = str_replace("src=\"","src=\"$domain\\",$result);

      Modified On Mar-31-2018 03:48:55 AM

Answer