Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98792

Invalid selector: Compound class names not permitted error using Selenium

$
0
0

I am trying to print one of my messages from a chat via webWhatsapp.

I was able to do it via Javascript from the Console tab i did it this way

recived_msg = document.getElementsByClassName('XELVh selectable-text invisible-space copyable-text') // returns an array of the chat
recived_msg[5].innerText // shows me the 4th message content

The problem is that i tried to do same thing on python but it doesnt work for me..

Heres what i tried:

from selenium import webdriver
recived_msg = driver.find_element_by_class_name('XELVh selectable-text invisible-space copyable-text')
final = recived_msg[5].innerText #doesnt work for some reason

my Error that i'm getting is: Message: invalid selector: Compound class names not permitted

I'm kinda new to javascript so sorry for missunderstanding and thank you for your help! :)


Viewing all articles
Browse latest Browse all 98792

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>