Is this code wrong? Not getting any elements using selenium on a webpage

import selenium

from selenium import webdriver

import time

PATH = 'C:\Program Files (x86)\chromedriver.exe'

driver = [webdriver.Chrome](https://webdriver.chrome/)(PATH)

driver.get("view-source:https://api.rollbit.com/x-roulette/rounds")

time.sleep(2)

table = driver.find_element_by_class_name('line-content')

print(table)

The classname is correct. im just getting this result:

[<selenium.webdriver.remote.webelement.WebElement (session=“dbf429b40164592def930860039b2fc7”, element=“38d7483c-2660-4485-8950-4a49f965c43e”)>]

  • ‘element’ is random everytime.
2 Likes

This is the log that I received by running your code:

Parameters{“using”: “class name”, “value”: “line-content”, “sessionId”: “d5198671bc0a869afe53e85d93ddc71b”} Response{“sessionId”:“d5198671bc0a869afe53e85d93ddc71b”,“status”:0,“value”:{“ELEMENT”:“0.7618870657568171-1”}}

1 Like

i dont think i understand, what does it mean?

1 Like

This is the response to your GET request.

You requested for

driver.find_element_by_class_name('line-content')

So the response is

Response{"sessionId":"d5198671bc0a869afe53e85d93ddc71b","status":0,"value":{"ELEMENT":"0.7618870657568171-1"}}

Now it would help if you could tell what you are expecting from the request

1 Like