from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
import selenium.webdriver.support.ui as ui
import selenium.webdriver.support.expected_conditions as EC
import os
import time
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument('--ignore-ssl-errors')
dir_path = os.path.dirname(os.path.realpath(__file__))
#Update Selenium chrome driver folder path here
chromedriver = dir_path + "/chromedriver"
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome(chrome_options=options, executable_path= chromedriver)
time.sleep(1)
driver.get("http://www.hungama.com/")
driver.maximize_window()
#driver.find_element_by_class_name("video_clk")
driver.find_element_by_xpath("//*[contains(text(),' VIDEOS')]").click()
time.sleep(5)
driver.find_element_by_xpath('//*[@title="Tamil"]').click()
#//*[@href=""]
time.sleep(5)
driver.find_element_by_xpath('//*[@href="http://www.hungama.com/video/maacho-from-mersal/31724136/"]').click()
time.sleep(10)
#//*[@id="videoPlayerObj"]/parent::div/child::div[7]/child::div[3]/child::ul/child::li[6]/child::a/child::i
driver.find_element_by_xpath('//*[@id="videoPlayerObj"]/parent::div/child::div[7]/child::div[3]/child::ul/child::li[6]/child::a/child::i').click()
driver.close
Comments
Post a Comment