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 日 · 2935 次点击
    这是一个创建于 2302 天前的主题,其中的信息可能已经有所发展或是发生改变。

    以前用 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 日
    不支持的,老老实实用 selenium。
    locoz
        2
    locoz  
       2019 年 10 月 14 日
    本来就是基于 pyppeteer 做的页面渲染效果,自己魔改一下就可以了。
    4BVL25L90W260T9U
        3
    4BVL25L90W260T9U  
       2019 年 10 月 14 日
    不要用这种垃圾库,越封装越烂
    ClericPy
        4
    ClericPy  
       2019 年 10 月 14 日
    作者都跑路了, 为什么还要用它... 趁早换个简简单单的 cdp 库吧, 直接注入个 js 就点击了
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   902 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 20:22 · PVG 04:22 · LAX 12:22 · JFK 15:22
    ♥ Do have faith in what you're doing.