• 请不要在回答技术问题时复制粘贴 AI 生成的内容
Johnson66
V2EX  ›  程序员

前端 debug 模式

  •  
  •   Johnson66 · Mar 5, 2019 · 3312 views
    This topic created in 2817 days ago, the information mentioned may be changed or developed.

    在前端查看网页,使用 debug 进行调试,在 console 下能正常得到结果 ,现在就想能不能自动化,我使用 selenium/splinter 打开浏览器 ,然后将网页 debug 再运行 js,得不到结果 。请问一下有没有大佬知道有没有什么方法可以得到和 console 一样的运行效果图一 图二

    Supplement 1  ·  Mar 5, 2019

    图一 图二

    10 replies  •  2019-03-05 18:39:21 +08:00
    relsoul
    relsoul
    Mar 5, 2019
    1
    =你的图都裂了,csdn 的外链肯定不能用的, 另外一个,你提供元素太少了 不知道怎么回答, 如果是同一个 chrome 版本等 是不可能得不到的 这个时候需要排除 对方网站是否有禁止爬虫浏览器,你打开 chrome-devtools 的时间是不是在结果之前,等等。
    RyanOne
    RyanOne
    Mar 5, 2019
    2
    Yishanshan
    Yishanshan
    Mar 5, 2019 via Android
    3
    @RyanOne 还是破的🤣
    RyanOne
    RyanOne
    Mar 5, 2019
    4
    ## 为啥 markdown 没直接出图呀
    RyanOne
    RyanOne
    Mar 5, 2019
    5
    代码里面 加上 debugger 不就进断点了嘛
    251243021
    251243021
    Mar 5, 2019
    6
    puppteer
    Johnson66
    Johnson66
    OP
    Mar 5, 2019
    8
    @251243021 感谢 等下回去仔细看看
    Johnson66
    Johnson66
    OP
    Mar 5, 2019
    9
    @relsoul 使用 chrome-devtools 我自己在浏览器上面手动 是可以的,用代码就不知道就不可以了 !
    Johnson66
    Johnson66
    OP
    Mar 5, 2019
    10
    @RyanOne 我是打断点,在前端 debug 好,才让程序往下走的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2123 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 02:20 · PVG 10:20 · LAX 18:20 · JFK 21:20
    ♥ Do have faith in what you're doing.