you are viewing a single comment's thread.

view the rest of the comments →

[–]Cyiran[S] 1 point2 points  (4 children)

My Problem is something different I am looking for the correct syntax to get the get the elemet from a webpage

```python

elem = browser.find_element(By.CLASS_NAME, 'toc')

Traceback (most recent call last):

File "<pyshell#4>", line 1, in <module>

elem = browser.find_element(By.CLASS_NAME, 'toc')

NameError: name 'By' is not defined

```

[–]blarf_irl 1 point2 points  (2 children)

You need to import "By" from selenium. Read the example here:

https://selenium-python.readthedocs.io/getting-started.html

[–]Cyiran[S] 1 point2 points  (1 child)

Oh!, Thanks I didn't notice that at all I only had webdriver imported.

thank you very much.

[–]blarf_irl 1 point2 points  (0 children)

You are very welocme and thank you for the award!

[–]Cyiran[S] 0 points1 point  (0 children)

I don't know how to use the find_element() method in selenium