V
V
VKR2282021-09-08 03:45:08
Python
VKR228, 2021-09-08 03:45:08

How to remove the code from the letter?

I can't get the code from the aliexpress email when registering an account

ss = driver.find_element_by_class_name('code').text
print(ss)

code from website
r0tspXa
( https://imgur.com/a/r0tspXa )
Error:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".code"}
(Session info: chrome=93.0.4577.63)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2021-09-16
@moonz

I recommend using xpath , just copy it through your browser's Dev tool.
Hover over the code in the email, and select "View Code" from the context menu (Google Chrome)
After making sure that the correct HTML code fragment is highlighted, right-click on it (in the Dev tool window), and select Copy from the context menu -> Copy XPath
Then I think it's clear what to do

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question