0

I am getting comments from website I tried it already and it worked well but now it gives me unusual output.

Part of my code:

comments = driver.find_elements_by_class_name("comment-text")
time.sleep(1)
print(comments[1])

The output:

<selenium.webdriver.remote.webelement.WebElement (session="bb6ae0409dd8ec8c191f9bd84f79bea7", element="5f5d4a2f-7a93-41fe-9ca5-aa4e7c525792")>

1 Answer 1

1

You want

print(comments[1].text)

You were printing the element itself which is just some GUID (I think). I'm assuming you want the text contained in the element which means you need .text.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.