A year ago I implemented this as well (albeit as a commercial offering with 100 free scrapes per month): https://2markdown.com
It also has javascript-enabled browsing available in private beta. Will make it public this week. In my experience, people fall back to the simple scraping and not use js that much, if at all.