Random errors with japanese #2
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: KaKi87/deepl-scraper#2
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It seems like I'm having trouble translating some things into japanese with this scraper.
Otherwise it's pretty solid! Great work :)
Here are some related error log lines:
I hope they may help :)
Got translation: ja-JA for: ui_stats_option | 統計情報
Got translation: ja-JA for: ui_stats_option_0 | なし
Got translation: ja-JA for: ui_stats_option_1 | エフピーエス
(node:15184) UnhandledPromiseRejectionWarning: Error: No node found for selector: .lmt__source_textarea
at assert (D:\MYPROJECT\node_modules\puppeteer\lib\helper.js:279:11)
at DOMWorld.type (D:\MYPROJECT\node_modules\puppeteer\lib\DOMWorld.js:421:5)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async translate (D:\MYPROJECT\node_modules\deepl-scraper\index.js:55:3)
-- ASYNC --
at Frame. (D:\MYPROJECT\node_modules\puppeteer\lib\helper.js:111:15)
at Page.type (D:\MYPROJECT\node_modules\puppeteer\lib\Page.js:1076:29)
at translate (D:\MYPROJECT\node_modules\deepl-scraper\index.js:55:14)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:15184) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 49)
Got translation: ja-JA for: ui_stats_option_2 | エムエス
(node:15184) UnhandledPromiseRejectionWarning: Error: No node found for selector: .lmt__source_textarea
at assert (D:\MYPROJECT\node_modules\puppeteer\lib\helper.js:279:11)
at DOMWorld.type (D:\MYPROJECT\node_modules\puppeteer\lib\DOMWorld.js:421:5)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async translate (D:\MYPROJECT\node_modules\deepl-scraper\index.js:55:3)
-- ASYNC --
at Frame. (D:\MYPROJECT\node_modules\puppeteer\lib\helper.js:111:15)
at Page.type (D:\MYPROJECT\node_modules\puppeteer\lib\Page.js:1076:29)
at translate (D:\MYPROJECT\node_modules\deepl-scraper\index.js:55:14)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:15184) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 50)
(node:15184) UnhandledPromiseRejectionWarning: Error: No node found for selector: .lmt__source_textarea
at assert (D:\MYPROJECT\node_modules\puppeteer\lib\helper.js:279:11)
at DOMWorld.type (D:\MYPROJECT\node_modules\puppeteer\lib\DOMWorld.js:421:5)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async translate (D:\MYPROJECT\node_modules\deepl-scraper\index.js:55:3)
-- ASYNC --
at Frame. (D:\MYPROJECT\node_modules\puppeteer\lib\helper.js:111:15)
at Page.type (D:\MYPROJECT\node_modules\puppeteer\lib\Page.js:1076:29)
at translate (D:\MYPROJECT\node_modules\deepl-scraper\index.js:55:14)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:15184) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 51)
Got translation: ja-JA for: ui_shader_quality_1 | 低
(node:15184) UnhandledPromiseRejectionWarning: Error: No node found for selector: .lmt__source_textarea
at assert (D:\MYPROJECT\node_modules\puppeteer\lib\helper.js:279:11)
at DOMWorld.type (D:\MYPROJECT\node_modules\puppeteer\lib\DOMWorld.js:421:5)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async translate (D:\MYPROJECT\node_modules\deepl-scraper\index.js:55:3)
-- ASYNC --
at Frame. (D:\MYPROJECT\node_modules\puppeteer\lib\helper.js:111:15)
at Page.type (D:\MYPROJECT\node_modules\puppeteer\lib\Page.js:1076:29)
at translate (D:\MYPROJECT\node_modules\deepl-scraper\index.js:55:14)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:15184) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 52)
Got translation: ja-JA for: ui_shader_quality_3 | 高
(node:15184) UnhandledPromiseRejectionWarning: Error: No node found for selector: .lmt__source_textarea
at assert (D:\MYPROJECT\node_modules\puppeteer\lib\helper.js:279:11)
at DOMWorld.type (D:\MYPROJECT\node_modules\puppeteer\lib\DOMWorld.js:421:5)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async translate (D:\MYPROJECT\node_modules\deepl-scraper\index.js:55:3)
-- ASYNC --
at Frame. (D:\MYPROJECT\node_modules\puppeteer\lib\helper.js:111:15)
at Page.type (D:\MYPROJECT\node_modules\puppeteer\lib\Page.js:1076:29)
at translate (D:\MYPROJECT\node_modules\deepl-scraper\index.js:55:14)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:15184) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 53)
Got translation: ja-JA for: ui_tunnel_inner_radius | トンネルサイズ
Got translation: ja-JA for: ui_user_color_a | メインカラー
Got translation: ja-JA for: ui_user_color_b | 2色目
Got translation: ja-JA for: ui_value_smoothing | 値の平滑化
Got translation: ja-JA for: ui_zoom_val | スピード
Example strings that seem to cause errors in this case:
translate("Mittel", "de-de", "ja-JA").then(...
Hello,
This works for me :
Hi, sorry for the late response.
The issues seems to appear randomly, when trying multiple translations with different languages too quickly.
ALSO: It seems like the translator will sometimes get confused and not switch the languages correctly. Example: first translating german -> italian, then german -> japanese
As you can see, the last three translations were still using italian as target language...
I'm not sure if that would be helpful for you, but here is my project:
https://github.com/hexxone/we_project_helper
and an example file for testing: https://raw.githubusercontent.com/hexxone/ReactiveInk/2fa9d93acb1ed1c35b38b0ba2940deb3e7fef98a/project.json
Thanks in advance :)
Can you tell me how exactly can I run your project ?
Regarding switching languages, I tested the following script which tests all target languages with a well-known english pangram synchronously :
Then I got the following output :
It seems to work as expected.
PS : at index.js:230, you should use
quit
fromdeepl-scraper
instead ofexit
fromprocess
.Excuse me, but where does it seem to work as expected?
If you look at the translations from your example, Once it reaches "nl" (netherlands) no matter which language, the result was always the same. That's also the issue I am having:
Expecting target language : zh-ZH
but result still in "nl":
Sorry if I have missed something, and I will try using quit, thanks :)
I'm sorry, you're right, I actually didn't bothered to read past italian.
I'm investigating now.
So, I've been making several tests, on several machines, and I've got different results :
It works up to
nl-NL
then stucks on it (most common case)Cf. first test above
It works every other time then throws an exception (your case)
It works perfectly (for real this time)
Considering the randomness of outcomes, I believe this is due to some reaction time of the DOM, so I'll try fixing the in-browser interactions.
Thanks for your patience.
Ok, thanks for the update :
Glad you are making progress.
I think I fixed your first issue (
Error: No node found for selector: .lmt__source_textarea
) byf684f108fe
with a simple line of code.However, I still don't know about the second one (result target language not matching request target language), so I made a fully-featured test suite (
00031739ca
to53c0271f20
).This one doesn't only do English-to-all but all-to-all translations with pangrams.
I ran it 4 times tonight and got the same result, give or take.
I don't have time for a detailed analysis yet, but I'll study it this week-end.
8d024b9846/deepl-scraper.log
Hello, here are the latest test results as per
178e6f6
.Nothing has changed, but I ran a new test because of class changed and new languages added by DeepL.
2589604f7b/deepl-scraper.log
Hello, here are the latest test results as per
644124a
and2eae081
.I ran a new test because of classes changed and languages listing changed, and the outcome unexpectedly became better (only in terms of result target language match with request target language).
Before :
After :
However it's not enough, because there 5 of those errors still occured and the remaining 34 errors are unknown.
I'll update the test script with error stack and auto-retry once.
7491708825/deepl-scraper.log