PhantomJS无法获取视频网址

时间:2020-09-27 14:06:01

标签: python selenium selenium-webdriver phantomjs

我要在此页面上获取视频的网址:https://wiki.haskell.org/99_questions/1_to_10

所以我在Phantomjs webdriver中使用了硒(Python)。

    driver.get("https://mixdrop.co/e/l664n1lds0l3q")

    driver.find_element_by_xpath('//div[@onclick="$(this).remove();MDinjectP2()"]').click()

    button = driver.find_element_by_xpath('//button[@class="vjs-big-play-button"]')

    button.click()

    data = driver.find_element_by_xpath('//video').get_attribute('src')

    print(data)

在Firefox Webdriver中使用这段代码可以为我提供所需的输出,但是当我使用Phantomjs时,此代码将不起作用。

能帮我吗?

0 个答案:

没有答案
相关问题