我想抓取一段视频,但是beauthulsoup不会等iframe加载。我尝试过使用selenium,但是googlewebdriver会等待整个页面的加载,而且要花很长时间。在页面加载完成后,我也无法获取页面源。在
这是我的代码,我用beauthulsoup试过了,但什么也没得到
def get_vidCode_from_source(source_url):
source_code = requests.get(source_url)
plain_text = source_code.text
soup = BeautifulSoup(plain_text,"html.parser")
print(soup.find('iframe'))
get_vidCode_from_source('http://anilinkz.io/one-piece-episode-769?src=3')
所以尝试在iframe中获取视频链接:
除了硒之外,还有什么能得到iframes的好处呢?在
我知道这有点旧,但是要使用selenium和获取页面源代码,请使用以下代码:
相关问题 更多 >
编程相关推荐