Skip to content

Commit 149a4b0

Browse files
authored
Updated deepl-cli in compliance with deepl changes (#296)
1 parent 4ba5949 commit 149a4b0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

deepl/deepl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ async def __translate(self, script: str) -> str: # noqa: C901, PLR0915
202202

203203
if self.use_dom_submit:
204204
# banner prevents clicking on language buttons, close the banner first
205-
await page.click("button[data-testid=cookie-banner-lax-close-button]")
205+
await page.click("button[data-testid=cookie-banner-strict-accept-all]")
206206
# we also expect the Chrome extension banner to show up
207207
with contextlib.suppress(PlaywrightError):
208208
await page.wait_for_function(
@@ -276,7 +276,7 @@ async def __translate(self, script: str) -> str: # noqa: C901, PLR0915
276276
# Since the site may not output all lines at once, we wait until each line is finished
277277
# and then add it to the list of translated lines
278278
translated_lines = []
279-
for line_index in range(line_count):
279+
for line_index in range(line_count - 1):
280280
try:
281281
await page.wait_for_function(
282282
f"""
@@ -321,7 +321,7 @@ async def __translate(self, script: str) -> str: # noqa: C901, PLR0915
321321
await output_textbox.get_attribute("lang"),
322322
).split("-")[0]
323323

324-
res = "".join(translated_lines)
324+
res = "\n".join(translated_lines)
325325

326326
await browser.close()
327327

0 commit comments

Comments
 (0)