Search code examples
pythoncssseleniumxpathlaravel-livewire

How do I refer to an attribute that contains a colon? (Selenium/python/xpath/css)


example html

Every field has the same property apart from the wire: model attribute, but I can't link to it as I don't have enough experience to write the correct selector. I would be very grateful if you can help me put together the correct selection.


Solution

  • See if this works:-

    textValues = driver.find_elements_by_xpath(".//div[@class='space-y-2']/input")
    for e in textValues:
        print(e.get_attribute("wire:model"))