---
title: "Techniques or tools for including a snippet of one web page in another"  
description: "Techniques or tools for including a snippet of one web page in another"  
author: "Manoj Bhatt"  
published: 2013-09-28  
updated: 2013-09-28  
canonical: https://www.mindstick.com/forum/1557/techniques-or-tools-for-including-a-snippet-of-one-web-page-in-another  
category: "css-css3"  
tags: ["css-css3"]  
reading_time: 1 minute  

---

# Techniques or tools for including a snippet of one web page in another

It's [common](https://www.mindstick.com/articles/23170/10-most-common-accounting-mistakes-of-small-business) [practice](https://yourviews.mindstick.com/story/1498/terrific-benefits-of-a-morning-meditation-practice) to include snippets of [one page](https://www.mindstick.com/forum/118/problem-in-display-content-of-one-page-to-another-page) in another as an image of the rendered [content](https://www.mindstick.com/articles/13019/get-the-best-content-marketing-pricing-packages-for-your-brand). This has obvious [disadvantages](https://www.mindstick.com/blog/300577/advantages-and-disadvantages-of-web-3-0), not least that text isn't being represented as text.

Are there any [techniques](https://www.mindstick.com/articles/13015/5-practical-tips-and-techniques-to-write-an-essay) or tools that allow swift excerpting from one [web page](https://www.mindstick.com/forum/718/sql-server-report-alignment-to-center-of-web-page), and embedding of the excerpted content in another page?

I imagine the excerpting [process](https://yourviews.mindstick.com/story/1525/7-important-factors-that-may-affect-the-learning-process) would have to [capture](https://answers.mindstick.com/qa/30907/which-phone-is-better-between-billion-capture-plus-and-xiaomi-mi-a1-and-moto-g5s-plus) enough stylesheet data to recreate it, [as well as](https://www.mindstick.com/interview/2481/can-you-write-a-java-class-that-could-be-used-both-as-an-applet-as-well-as-an-application) 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.

## Replies

### Reply by Anonymous User

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);
```


---

Original Source: https://www.mindstick.com/forum/1557/techniques-or-tools-for-including-a-snippet-of-one-web-page-in-another

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
