Jul-10-2021, 01:29 PM
HI I have a question related to HTML readers. I try to use selenium to scrap the video, but it seems not working. I just want to grab the src link. i use the chrome development tool and is able to find it, but when I used XPath in selenium will pop an error.
i saw it related to https://stackoverflow.com/questions/3129...ideo-links.
When i used driver.find_element_by_xpath , it occur error
below is HTML
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="lmy_video_1_html5_api"]"}
(Session info: chrome=91.0.4472.114)
i saw it related to https://stackoverflow.com/questions/3129...ideo-links.
When i used driver.find_element_by_xpath , it occur error
below is HTML
<html> <head> <body> <div> <html> <head> <body> <div id="container" > <div tableindex= -1> <video id="my_video_1_html5_api" class="vjs-tech" controlslist="nodownload" preload="auto" poster="https://vs02.520call.me/files/mp4/f/ttttt.jpg" <source src="https://vs02.520call.me/files/mp4/f/fwnOT.m3u8?t=1234444” type="application/vnd.apple.mpegurl"></video>i try with this three way unable to grab the src link, but none of them is able to geable the src
driver.find_element_by_xpath(‘//*[@id=“my_video_1_html5_api”]’) driver.find_element_by_xpath('//*[@class="vjs-tech"]') driver.find_element_by_id('lmy_video_1_html5_api')it occur error:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"[id="lmy_video_1_html5_api"]"}
(Session info: chrome=91.0.4472.114)