Closed freigus closed 4 years ago
I tried your code in Win10 Py3.6 without any problem. I am not sure what the problem is. The lib should run in Py3.7 since it builds OK (https://github.com/ffreemt/deepl-tr-async/actions/runs/79603579).
Your code seems to be quite alright for an interactive session (maybe loop = asyncio.get_event_loop()
should be moved out of the while loop). When doing a batch of sents, it will be much more efficient to make use of the async nature of deepl_tr_async.
I updated to 0.0.2 and it's still crushes after 20 seconds. I tried to run code mentioned above under different conditions:
And every time it crashed after 20 seconds. Now - more verbosity (a lot of logs from ubuntu) (I hope it can make something understandable):
Next few tries had the same error. After this I went and closed 20-25 chrome processes in system monitor.
After this I started to close chromes after every try and I always encountered browser.newPage exc: Connection is closed, failed attempt: 2
After switching to 4G connection nothing changed. (yes, i'm totally out of ideas)
A new version (0.0.3) is available, pip install deepl-tr-async -U
to upgrade. The new version uses pyppeteer2. You may need to remove puppeteer (pip remove puppeteer
) and install puppeteer2 (pip install puppeteer2).
If you really want to saty with deepl-tr-async 0.0.2, try this patch: https://github.com/miyakogi/pyppeteer/pull/160/files
Updated to 0.0.3 and puppeteer2 and it works! Thank you!
Sorry, it might be a very noob question. When I'm trying to use
res = loop.run_until_complete(deepl_tr_async(sent, to_lang='ru', from_lang='en'))
in a loop it stops working after about 20 seconds with an errorProtocol Error (Runtime.callFunctionOn): Session closed. Most likely the page has been closed.
Code that I'm trying to use:Log for this code is:
Am I doing something wrong? Should I somehow restart chromium page every time it closes? I'm using Windows 10 1909. Python 3.7