I'm looking to pull the meta tag description and title from any site. Is there a way to do this with NextJS? I've tried a few different libraries and approaches but haven't had much luck.
Here is the code I made to fetch a sites text. I just need a simple way to parse that text ideally without regex:
export default function Home({ data }) {
return (
<pre>{data}</pre>
)
}
export async function getServerSideProps() {
const res = await fetch(`https:nextjs.org`)
const data = await res.text()
return { props: { data } }
}