rashikzaman / scrapper-react

0 stars 0 forks source link

Rendering of HTML content #4

Open olivierobert opened 2 years ago

olivierobert commented 2 years ago

As raised in https://github.com/rashikzaman/search-scrapper/issues/4, the HTML content should be best not stored on the local file system on the API server. Instead, it should either be stored in the database or in another remote storage. In the case of storing the HTML content into the database, how would you handle the display of its content on the client application? This presents some challenges since it the content would return the complete DOM tree for an HTML page (<HTML> + everything in between + </html>).

rashikzaman commented 2 years ago

Rendering html string in react can be done by using dangerouslySetInnerHTML. These will render the string as html content

olivierobert commented 2 years ago

Or another option would be to have an iframe as it would allow to render the content of another webpage in a page :-)

rashikzaman commented 2 years ago

That is definitely a good idea something that I've not thought of :D