[Python] Selecting options from Auto Complete Dropdown using selenium web driver in python

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    I have to select options from a drop down on a page. I tried the below code but it is showing a syntax error. Can somebody help me with this?

    web_element x = driver.find_element_by_xpath('//*[@id="txtSearchPhone"]')
    Select sel = new Select(x)
    sel.select_by_value("Iphone")


    I tries Web_element, WebElement too. But this is showing syntax error for the very first line.

    web_element x = driver.find_element_by_xpath('//*[@id="txtSearchPhone"]')
    ^
    SyntaxError: invalid syntax

    Continue reading...

Compartilhe esta Página