1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] Cannot find play button on a web page in selenium using python

Discussão em 'Python' iniciado por Stack, Setembro 28, 2024 às 12:02.

  1. Stack

    Stack Membro Participativo

    I am using Python 3.11.9 in windows with google chrome Version 126.0.6478.127 (Official Build) (64-bit).
    Here is the simple code
    driver = webdriver.Chrome()
    url = "https://onlineradiofm.in/stations/vividh-bharati"
    driver.get(url)
    radio_is_paused=True
    while radio_is_paused:
    time.sleep(30)
    play_buttons = driver.find_elements(By.XPATH,'/html/body/div[2]/div/div/div/div[1]/div/div[1]/div/div[2]/div[1]/svg[1]/g/circle')
    if len(play_buttons)>0:
    print(len(play_buttons),' play buttons found')
    else:
    print('play button not found')
    driver.quit()


    I can see that web page gets opened in a browser and play button is visible .
    I am not able to find out the reason that why I get 'play button not found' ?
    I have also tried xpath //*[@id="play"]/g/circle , but got same result .
    Thanks.

    Continue reading...

Compartilhe esta Página