123456789101112131415161718192021222324252627282930313233 |
- const cheerio = require('cheerio');
- const webdriver = require('selenium-webdriver');
- var entities = require('html-entities').XmlEntities;
- const { saveFile } = require('../tools/save-file');
- /**
- * 获取视频 (未完)
- * @param { WebDriver } driver
- */
- function videoData(driver) {
- return new Promise((resolve, reject) => {
- driver.findElement(webdriver.By.js(() => document.querySelectorAll('.J_playVideo')))
- .then(videoPlayBtn => {
- if(videoPlayBtn){
- videoPlayBtn.click();
- driver.findElement(webdriver.By.js(() => document.querySelectorAll('.lib-video video')))
- .then(videoEle=>{
- videoEle.getAttribute('src')
- })
- }else{
- return '';
- }
- })
- });
- }
- exports.videoData = videoData;
|