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

AttributeError: NoneType object has no attribute 'current_url' #33

Open
Aza-ze1 opened this issue Dec 6, 2020 · 4 comments
Open

AttributeError: NoneType object has no attribute 'current_url' #33

Aza-ze1 opened this issue Dec 6, 2020 · 4 comments

Comments

@Aza-ze1
Copy link

Aza-ze1 commented Dec 6, 2020

Installed the CLI a few mintues ago and tried running the interactive session. I could login but I couldn't check my inbox, and this error kept showing up.

Traceback (most recent call last):
  File "/usr/bin/protonmail-cli", line 163, in <module>
    session.start()
  File "/opt/protonmail-cli/protonmail/interactive.py", line 160, in start
    options[choice]["function"]()  # call the anonymous function that is attached on menu choice
  File "/opt/protonmail-cli/protonmail/interactive.py", line 135, in <lambda>
    "function": lambda: self.show(opt)
  File "/opt/protonmail-cli/protonmail/interactive.py", line 103, in show
    for mail in self.client.get_mails(page):
  File "/opt/protonmail-cli/protonmail/core.py", line 157, in get_mails
    if self.web_driver.current_url != url:
AttributeError: 'NoneType' object has no attribute 'current_url'```

@dimkouv
Copy link
Owner

dimkouv commented Dec 7, 2020

@Aza-ze1 Try setting show_browser=True in settings.py and try again.
I'll look at the issue later this week.

@Aza-ze1
Copy link
Author

Aza-ze1 commented Dec 7, 2020

I tried that and it still shows the same error.

Traceback (most recent call last):
  File "/usr/bin/protonmail-cli", line 163, in <module>
    session.start()
  File "/opt/protonmail-cli/protonmail/interactive.py", line 160, in start
    options[choice]["function"]()  # call the anonymous function that is attached on menu choice
  File "/opt/protonmail-cli/protonmail/interactive.py", line 135, in <lambda>
    "function": lambda: self.show(opt)
  File "/opt/protonmail-cli/protonmail/interactive.py", line 103, in show
    for mail in self.client.get_mails(page):
  File "/opt/protonmail-cli/protonmail/core.py", line 157, in get_mails
    if self.web_driver.current_url != url:
AttributeError: 'NoneType' object has no attribute 'current_url'

@dimkouv
Copy link
Owner

dimkouv commented Dec 13, 2020

@Aza-ze1 I just tested and it works fine from my side. Try debugging with show_browser=True while looking at the console messages. Also try setting a bigger load_wait value in settings.py.

@joeybronzoni
Copy link

joeybronzoni commented Feb 27, 2021

Hey Birds, wanted to see if @Aza-ze1 found what the problem was? I have this setup on raspberry pi using geckodriver. I've had it working a long time ago(maybe months actually but I haven't toyed with it in quite some time). I either get the same exact error as @Aza-ze1 mentioned or I get this one:

>>> client.send_mail(
...     "my-emaili@protonmail.com",
...     "subject",
...     "my mail message"
... )
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/home/pi/proton-cli-test/venv/lib/python3.7/site-packages/protonmail/core.py", line 374, in send_mail
    el = self.web_driver.find_element_by_class_name(
AttributeError: 'NoneType' object has no attribute 'find_element_by_class_name'

Any thoughts? I've tried adjusting the settings like @dimkouv stated but the debug log isn't giving me anything other than:

>>> client.send_mail(
...     "my-emaili@protonmail.com",
...     "subject",
...     "my mail message"
... )
Traceback (most recent call last):
  File "<stdin>", line 4, in <module>
  File "/home/pi/proton-cli-test/venv/lib/python3.7/site-packages/protonmail/core.py", line 374, in send_mail
    el = self.web_driver.find_element_by_class_name(
AttributeError: 'NoneType' object has no attribute 'find_element_by_class_name'

And yes @dimkouv this is a project that I will be using a bunch once I get a grock on things. So yes thanks for this one. Hoping I have something to contribute the more that I use it -slowly but surely. I mean, this is great.

Edit: I guess this is more of a webdriver issue. I think. But I will return with a solid answer.

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

3 participants