# Use a Korean query with WebExecute?

Posted 2 years ago
3483 Views
|
6 Replies
|
3 Total Likes
|
 Dear sir/madam, I have a query regarding WebExecute of WL12. So far, i have well fetched lat/lon coordinates from GoogleMap using ExtenalEvaluate & WebUnit in WL11.3. As in the yellow highlight region of attachment01, an english query (e.g. KOEX) is well activated to get successful results. But, if i use any Korean query (e.g. "???") in the same place, only to fail in result (refer to the error message in attachment02). Is there any workaround to this input problem?Thanks in advance, Ho-Woong Attachments:
6 Replies
Sort By:
Posted 2 years ago
 Thank you for reporting this! It is a known issue and our teams are working on a fix. We are not sure yet about possible workarounds. If we find out we will update this discussion.
Posted 2 years ago
 Thanks for your swift feedback. Please let me know whether Chinese or Japanese query has the same issue. If not, there's a discrepancy in Asian deployment policy of Wolfram.Ho-Woong
Posted 1 year ago
 TextTranslation of the query can fix this problem. Relevant Code: WebExecute[session, "TypeElement" -> {input, TextTranslation["???"]}] Thanks to Mr. Dev Budhathoki (@Wolfram Research) for the suggestion.
Posted 1 year ago
 Any diacritics in WebExecute will cause the same bug, as you can check in this post: https://community.wolfram.com/groups/-/m/t/1897363Maybe the same temporary workaround can solve your case.
 I just confirmed your example. It's the same for latin characters encoding. Here is @Arnoud Buzing solution from this post. Just execute the code below to fix the WebUnit fetch function. Here is an example: StartWebSession["Chrome"]; WebExecute["OpenPage"->"https://www.google.com/maps"]; input = First@WebExecute["LocateElements"->"XPath"->"//input[@id = 'searchboxinput']"]; Now execute: ClearAll[WebUnitPrivatefetch]; WebUnitPrivatefetch[ WebUnitPrivatesessioninfo_, WebUnitPrivatetype_, WebUnitPrivatepath_, WebUnitPrivatedata_, WebUnitPrivatekey_ ] := Module[{ WebUnitPrivateres, WebUnitPrivatefetchResult }, WebUnitPrivatefetchResult = URLRead[ HTTPRequest[ WebUnitPrivatesessioninfo[[3]] <> WebUnitPrivatepath, <| "Method" -> WebUnitPrivatetype, "Body" -> WebUnitPrivatejson[WebUnitPrivatedata] |> ], "BodyByteArray" ]; If[ !ByteArrayQ[WebUnitPrivatefetchResult], Return[$Failed] ]; If[ ImportByteArray[WebUnitPrivatefetchResult, "Text"] === "missing command parameters", Return[$Failed] ]; WebUnitPrivateres = ImportByteArray[WebUnitPrivatefetchResult, "JSON"]; WebUnitPrivateDebugPrint[ WebUnitPrivateformat[WebUnitPrivateres] ]; WebUnitPrivatekey /. WebUnitPrivateres ] And you can test with: WebExecute["TypeElement"-> {input, "평양"}] or as in my case WebExecute["TypeElement"-> {input, "São Paulo"}] Works fine! WebExecute is cool, but it's in It first version yet. I Hope to have better sendKey in the future version, with more options as I ask in this post.Note1- The bug is for any entry of WebExecute using non standard characters, not just for "TypeElement". For example WebExecute["LocateElements" -> "XPath" -> "//input[text() = 'São Paulo']"] will break either without redefine WebUnitPrivatefetch.2- Redefine WebUnitPrivatefetch before StartWebSession will not work in a fresh kernel. It needs to be after StartWebSession.