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
uti6770werty
V2EX  ›  Python

request-html 库,能不能对页面上的“对象”进行点击操作?

  •  
  •   uti6770werty · 2019-10-13 23:35:35 +08:00 · 2566 次点击
    这是一个创建于 1628 天前的主题,其中的信息可能已经有所发展或是发生改变。

    以前用 selenium 时:

            driver.find_element_by_id('tabmenuA').click()
            time.sleep(1)
            OtherHtmlPage = driver.page_source
    

    这样就获得了 OtherHtmlPage 这个经过点击表格 tab,然后也经过 WebDriver 渲染的页面代码了

    不清楚 request-html 库能不能这么操作? 看过官方的文档,好像也没这样的例子...,只是知道作者在 request 的基础上似乎能对网页渲染支持很好...

    arrow8899
        1
    arrow8899  
       2019-10-14 10:08:29 +08:00
    不支持的,老老实实用 selenium。
    locoz
        2
    locoz  
       2019-10-14 10:30:51 +08:00
    本来就是基于 pyppeteer 做的页面渲染效果,自己魔改一下就可以了。
    ospider
        3
    ospider  
       2019-10-14 10:56:34 +08:00
    不要用这种垃圾库,越封装越烂
    ClericPy
        4
    ClericPy  
       2019-10-14 12:01:24 +08:00
    作者都跑路了, 为什么还要用它... 趁早换个简简单单的 cdp 库吧, 直接注入个 js 就点击了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5475 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 06:41 · PVG 14:41 · LAX 23:41 · JFK 02:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.