Updated deepl DOM handling#314
Closed
Monsterovich wants to merge 4 commits into
Closed
Conversation
Contributor
Author
|
ping @eggplants |
Contributor
Author
|
There is a problem, though: # Wait for translation to complete (check that progress text is empty)
if len(script) > 500:
try:
await page.wait_for_function(
"""
() => {
const elem = document.querySelector('#progress-text');
const text = elem?.textContent ?? '';
return text.length == 0;
}
""",
timeout=self.timeout,
)
except PlaywrightError as e:
msg = f"Translation incomplete after {self.timeout} ms"
raise DeepLCLIPageLoadError(msg) from e
else:
await page.wait_for_timeout(timeout=5000) |
Contributor
Author
|
Backported the code suggested by @noembryo. Input via DOM manipulation is currently completely broken. Also, you now need to install the browser using the ping @eggplants |
Contributor
Author
Closed
Owner
Contributor
Author
|
@eggplants I still get error You should probably remove this line and use https://github.com/eggplants/deepl-cli/blob/master/deepl/deepl.py#L246 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fix: #315