I'm trying to make an python script to download videos from animefreak.tv so I can watch them offline while I'm on a roadtrip. Plus I thought it was a good opportunity to learn some webscraping.
I wrote this so far to download from this link http://animefreak.tv/watch/hacklegend-twilight-bracelet-episode-1-english-dubbed-online-free
URL = 'http://animefreak.tv/watch/one-piece-episode-1-english-dubbed-subbed'
IFRAME_POSITION = 2
# driver = webdriver.PhantomJS(service_args=['--ignore-ssl-errors=true'])
driver = webdriver.Chrome()
driver.get(URL)
src = driver.page_source
parser = BeautifulSoup(src, 'lxml')
driver.switch_to.frame(IFRAME_POSITION)
video = driver.find_element(By.XPATH, '//*[@id="player"]/div[2]/video')
touch = webdriver.TouchActions(driver)
touch.tap(video)
print('src: ', video.get_property('src'))
driver.close()
Whenever I run the script the src attribute doesn't show up. What am I doing wrong? Thank you!