OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

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

  • Thread starter Thread starter user1371666
  • Start date Start date
U

user1371666

Guest
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
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.
<br>
I am using Python 3.11.9 in windows with google chrome Version 126.0.6478.127 (Official Build) (64-bit).<br>
Here is the simple code
<pre><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()
</code></pre>
<p>I can see that web page gets opened in a browser and play button is visible .<br>
I am not able to find out the reason that why I get 'play button not found' ?<br>
I have also tried xpath //*[@id="play"]/g/circle , but got same result .<br>
Thanks.</p>
 

Latest posts

Top