yorkittran / google-scraper

0 stars 0 forks source link

[Feature] Render the stored HTML in the UI #13

Open olivierobert opened 1 year ago

olivierobert commented 1 year ago

Issue

While the Google search result content is stored in the database, users can only view the HTML as code. The page is not viewable.

https://github.com/yorkittran/google-scraper/blob/e2f9bccc0bb7ef45b446e5db61b0d69cd3a56167/app/views/crawl_results/show.html.slim#L9-L14

As a result, a user cannot verify if the scraping results are correct.

Expected

The HTML content should be viewable on the application, e.g., there could be a view of the content on a new page or in a modal.

Note There is a bit of a challenge to render HTML content from another page. Hence it is an expected feature of the application.

yorkittran commented 1 year ago

I created a button to render HTML sources on a new tab of the browser. But unfortunately, it will miss some CSS or images if it serves absolute paths

olivierobert commented 1 year ago

If the links of the resources are not altered, the content should be displayed correctly, though 🤔

To solve this challenge, an iframe must be used. Iframes supports passing an HTML string (see docs)