-3

This might sound like a very strange question but I'm wondering if it's possible to take only a small part of an original website and use that part on a new website without having the direct access to the database?

The site displays latest entries of items added to a database and it contains a lot of stuff that is unnecessary which I want to get rid off. The new site should supposedly only display the div with the id "content" and everything in it. Here is the site: link to site

I've tried to inspect the elements on the site and copy the html code but the problem is that it converts all the added items to string instead of loading it directly from the database.

The reason why I want to learn how to do this is nothing more than an interest in how it can be done that could be helpful later on.

Markus
  • 3
  • 3
  • 1
    Well, yes, *you* will only have access to the "string" in the HTML. The site doesn't send you a database access or anything. Learn something about the bare basics of database driven web development and it should be obvious what's going on here. – deceze Dec 11 '15 at 13:32
  • Thanks for your answer. If I understand you correctly the only way to access it is by using some kind of iframe? It seems to me there must be another way than loading the entire site as it is – Markus Dec 11 '15 at 13:37

1 Answers1

0

What you can do is two things. If you want to get the data from a website that doesn't provide an API you can write an HTML parser to grub the desired data. Note that this is likely to break in the future, if the original site makes any changes to the html.

If you want to display a part of the website as it is you can use an iframe to embed the original site to your site and then use js to hide what you don't want to show. See here for more info.

Community
  • 1
  • 1
jzlas
  • 187
  • 2
  • 11
  • Thank you a lot for that link! This is most likely what I had in mind! I see that my question get a lot of downvotes and I suppose it has to do with how it could be considered of "stealing". This is not my intention since I do this completely to learn more on how and if it is possible. If I ever get to work with something like this I will always ask before do it. – Markus Dec 11 '15 at 13:43