V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
duohedianshuihao
V2EX  ›  Python

新手请教一个爬虫问题

  •  
  •   duohedianshuihao · 2017-06-27 13:18:20 +08:00 · 3172 次点击
    这是一个创建于 2499 天前的主题,其中的信息可能已经有所发展或是发生改变。

    目的是想要爬取这个地址的视频

    观察到播放地址是 https://openload.co/stream + 后半部分,然后在 chrome 里看到后半部分保存在

    <span id="streamurl">3D6-Nb3wdg4~1498616112~2607:fea8::~ZC1cvud5</span>
    

    而这个标签在 iframe 里面,iframe 已经再次加载了,但是看到的结果是

    <span id="streamurl">HERE IS THE LINK</span>
    

    现在就是找到后半部分地址就行了,但到这里我就不知道怎么办了,求指教,谢谢! 哦对了,想用 requests 实现

    5 条回复    2017-08-11 21:26:01 +08:00
    yuyeson
        1
    yuyeson  
       2017-06-27 13:37:14 +08:00
    信息太少了
    tinyproxy
        2
    tinyproxy  
       2017-06-27 15:12:29 +08:00
    duohedianshuihao
        3
    duohedianshuihao  
    OP
       2017-06-27 21:46:49 +08:00
    @yuyeson 我不太知道下一步该怎么做,就是请求 https://openload.co/embed/3D6-Nb3wdg4/这个地址,chrome 里显示的是上面一个 span,然后我自己请求得到的结果是下一个 span,我没有找到是在哪里替换着两个 span 的内容的。
    duohedianshuihao
        4
    duohedianshuihao  
    OP
       2017-06-27 21:49:38 +08:00
    @tinyproxy 好吧,没注意到…
    ianchn
        5
    ianchn  
       2017-08-11 21:26:01 +08:00
    @tinyproxy 这个 API 只能下载自己账号内的内容, 不能用来写爬虫。

    楼主的这个问题,youtube-dl 的这个 Issue 里有跟踪和讨论 https://github.com/rg3/youtube-dl/issues/10408,openload 对绕过广告直接下载很敏感,设置了一些反爬虫策略。这里是解决办法: https://gist.github.com/Tithen-Firion/8b3921d745131837519d5c5b95b86440
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   830 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 21:56 · PVG 05:56 · LAX 14:56 · JFK 17:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.