In [8]:
from selenium import webdriver
import time
In [4]:
speech_rec = webdriver.Chrome()
speech_rec.get('https://translate.google.com/?#id/en')
assert "Google Translate" in speech_rec.title
In [11]:
def get_speech():
record = speech_rec.find_element_by_xpath('//*[@id="gt-speech"]/span')
record.click()
time.sleep(4)
record.click()
source = speech_rec.find_element_by_xpath('//*[@id="source"]')
a = source.get_attribute("value")
print a
return a
In [28]:
Out[28]:
In [26]:
In [ ]: