-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
SyntaxError: Unexpected token '=' #7
Comments
Hi Stanley, Unfortunately, the stacktrace does not show any file belonging to this package. can you please share your code? Please also mind the order of imports. Importing selenium components after this this package may cause configuration changes. |
Yeah. `from config import keys def timeme(method): @TImeME
if name == 'main': |
I rewrote the program without any selenium imports but the problem is I need either time or seleniums common exceptions to be imported for my program to work and no matter where I add either of these packages before or after the uc chromdriver it returns the same error |
You need to import selenium AFTER this package. See the README -> second or third usage example! |
import undetected_chromedriver as uc
uc.install() # < important
from selenium.webdriver import Chrome # and all other offical selenium stuff you need
driver = Chrome()
driver.get('https://distilnetworks.com') |
Just downloaded it but now when I run my program I keep getting this error selenium.common.exceptions.WebDriverException: Message: unknown error: Runtime.evaluate threw exception: SyntaxError: Unexpected token '='
I changed it back to normal selenium chromedriver and it worked fine so I am not sure what's going wrong as it does not seem to be my code
Here is the full error message
Selenium patched. Safe to import Chrome / ChromeOptions
Selenium patched. Safe to import Chrome / ChromeOptions
Traceback (most recent call last):
File "botc.pyx", line 89, in
order(keys)
File "botc.pyx", line 21, in wrapper
result = method(args, **kw)
File "botc.pyx", line 40, in order
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '//[contains(text(), "Large")]'))).click()
File "/usr/local/lib/python3.8/dist-packages/selenium-3.141.0-py3.8.egg/selenium/webdriver/remote/webelement.py", line 80, in click
self._execute(Command.CLICK_ELEMENT)
File "/usr/local/lib/python3.8/dist-packages/selenium-3.141.0-py3.8.egg/selenium/webdriver/remote/webelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "/usr/local/lib/python3.8/dist-packages/selenium-3.141.0-py3.8.egg/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.8/dist-packages/selenium-3.141.0-py3.8.egg/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Runtime.evaluate threw exception: SyntaxError: Unexpected token '='
(Session info: chrome=81.0.4044.92)
The text was updated successfully, but these errors were encountered: