Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in browser.py #1

Open
credo99 opened this issue Feb 3, 2020 · 3 comments
Open

Error in browser.py #1

credo99 opened this issue Feb 3, 2020 · 3 comments

Comments

@credo99
Copy link

credo99 commented Feb 3, 2020

Hi, thanks for the project is extremely useful. It would be great if you could post a few lines about the usage commands. I figured out from the ebook_translator.py there is a way to eidt the last block in order to change the language and file parameters for what I need but ran into these problems:

Reading text into memory.
Tokenizing text into sentences.
Starting translation from the beginning.
Initializing DeepL translator
Traceback (most recent call last):
File "./scripts/ebook_translator.py", line 64, in
ebook_translator = EbookTranslator(path, "de", "en", engine="DeepL")
File "./scripts/ebook_translator.py", line 17, in init
self.translator = Translator(source_language, target_language, engine)
File "C:\Users\Netadmin\Documents\GitHub\EbookTranslator\scripts\translator.py", line 14, in init
self.set_engine(engine)
File "C:\Users\Netadmin\Documents\GitHub\EbookTranslator\scripts\translator.py", line 22, in set_engine
self.engine = DeepLEngine(self.source_language, self.target_language)
File "C:\Users\Netadmin\Documents\GitHub\EbookTranslator\scripts\translator.py", line 58, in init
self.browser = Browser(headless=True)
File "C:\Users\Netadmin\Documents\GitHub\EbookTranslator\scripts\browser.py", line 38, in init
self.start()
File "C:\Users\Netadmin\Documents\GitHub\EbookTranslator\scripts\browser.py", line 41, in start
chrome_binary = self.choose_browser_binary()[0]
TypeError: 'NoneType' object is not subscriptable

Do you know why?

Thanks,

Radu

@plysytsya
Copy link
Owner

Looks like you don't have a proper selenium setup. You need the chrome or geckodriver (firefox) from seleniumhq.org
Then put the binary-file (chromedriver, or geckodriver) into a directory called "webdrivers" under scripts, i.e. /scripts/webdrivers/chromedriver

@plysytsya
Copy link
Owner

You can also temporarily set headless to False to see if the browser starts up properly.

@plysytsya
Copy link
Owner

plysytsya commented Feb 23, 2020

I also pushed a wrapper for a google translator on the google cloud platform (it's paid but you can use it for free in the first year). It's in the GCP branch. All in all I started to use the paid thing without paying because the selenium scraper is very slow and hard to maintain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants