I am currently attempting to perform web scraping on a website using the got library.
Below is the simple code that I have written:
import got from 'got';
async function test(){
const data = await got('https://dhlottery.co.kr/store.do?method=topStore&pageGubun=L645', { encoding: 'utf8'});
console.log(data.body);
}
test();
The code works fine, but it does not display Korean characters correctly.
An excerpt of the output is shown below:
<div class="foot_txt2">
<p>Copyright (c) 2018 ȸ&ູ. All rights reserved</p>
<p> Ȩ Խõ ̸ ּҰ ڵ Ǵ źϸ, ̸ ݽ Ÿ ó Ͽ ֽñ ٶϴ.</p>
<p class="f_blue2">ûҳ ϰų ÷ ϴ.</p>
</div>
All the corrupted words appear to be in Korean.
I am curious as to why this issue is occurring and how it can be resolved.