微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

抓取网络流量 selenium Python 的问题

如何解决抓取网络流量 selenium Python 的问题

我正在尝试抓取 http://live.jokerswidget.com/freelivematch/8534782740463890.html 的网络流量(或此处遵循相同结构 http://live.jokerswidget.com/ 的任何链接)。我可以在网络控制台上看到 m3u,但在 Selenium 上看不到。

这是我的代码

option = Options()
option.add_argument("--autoplay-policy=no-user-gesture-required")
option.add_argument("--auto-open-devtools-for-tabs")

driver = webdriver.Chrome(chrome_options=option)
driver.get(url)
sleep(3)
res=np.nan
Resources = driver.execute_script("return window.performance.getEntries();")
    
for resource in Resources:
        print(resource['name'])
        res=resource['name']
driver.quit()

这就是我得到的:

http://live.jokerswidget.com/freelivematch/8534782740463890.html
https://www.googletagmanager.com/gtag/js?id=UA-27618511-18
first-paint
https://player.playjoke.xyz/all.js?v=08
http://player.playjoke.xyz/getfull.PHP?u=lshnba6hd167&vw=640&vh=360
http://widgets.amung.us/classic.js
https://www.google-analytics.com/analytics.js
http://whos.amung.us/pingjs/?k=wplivewidget&t=Boston%20Celtics%20-%20New%20York%20Knicks&c=c&x=http%3A%2F%2Flive.jokerswidget.com%2Ffreelivematch%2F8534782740463890.html&y=&a=0&d=1.146&v=27&r=2385
https://www.google-analytics.com/j/collect?v=1&_v=j87&a=745048593&t=pageview&_s=1&dl=http%3A%2F%2Flive.jokerswidget.com%2Ffreelivematch%2F8534782740463890.html&ul=es-es&de=UTF-8&dt=Boston%20Celtics%20-%20New%20York%20Knicks&sd=24-bit&sr=1536x864&vp=482x658&je=0&_u=IEBAAUABAAAAAC~&jid=456610168&gjid=1120215787&cid=640250925.1610908970&tid=UA-27618511-18&_gid=42964424.1610908970&_r=1&gtm=2ou161&z=1091977015
http://live.jokerswidget.com/favicon.ico

我有兴趣获取 m3u 链接

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。