3

i'm trying make autotest by selenium and laravel

everysing it is ok, but error comes out when get korean text

i'm think it's incoding problem but i don't know how can fix that

error look like this,

i must get text data like

'한국어'.

but now is i get textdata like

 'ì¤ì ë,ìì§ìë£,'.

and iconv not work for this problem

 $target = $driver->findElement(WebDriveryBy::xpaht('target'))->getAttribute('innerText');
 $target = iconv('ECU-KR', 'UTF-8', $target);
 Log::alert($target);

 --result

 'ì¤ì ë,ìì§ìë£,'.

please help me to how solve this proble. thanks for reading my post.

below is html in target site enter image description here

Choi yun seok
  • 309
  • 2
  • 15
  • Can you post the HTML in the `` of the document? Maybe the web page is the problem? – Greg Burghardt Sep 18 '19 at 22:18
  • i'm added streen shot in my post – Choi yun seok Sep 19 '19 at 07:04
  • Hm. ok. That should be fine, especially if the text appears fine in the web browser. Is the `Log::alert` function what you are using to display the text? Maybe the problem is with the `Log::alert` function? What does `echo $target` show? – Greg Burghardt Sep 19 '19 at 11:04
  • have never seen a less discussed topic than selenium on SO... nothing get answered ever with this tag it seems :-/ Did you end up solving this? If so how? Btw an ugly workaround would be to get the source, save the file and then read the local file content. Because when saving it, it seems like encoding issues are fixed as opposed to reading the markup directly. – Robert Sinclair Aug 21 '20 at 17:49

0 Answers0