I am trying to extract the source link of an HTML5 video found in a video tag. Using Firefox webdrive, I can get the desired result, i.e. -
[<video class="video-stream html5-main-video" src='myvideoURL..'</video>]
but if I use PhantomJS -
<video class="video-stream html5-main-video" style="width: 854px; height: 480px; left: 0px; top: 0px; -webkit-transform: none;" tabindex="-1"></video>
I suspect this is due to the lack of PhantomJS support for HTML5 video support. Anyway, can I fool a webpage into thinking that HTML5 Video is supported so that it generates a URL? Or can I do something else?
tried it
try:
WebDriverWait(browser,10).until(EC.presence_of_element_located((By.XPATH, "//video")))
finally:
k = browser.page_source
browser.quit()
soup = BeautifulSoup(k,'html.parser')
print (soup.find_all('video'))
Vrisk source
share