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

打印用 JS 跳转的下一页的 URL

  •  
  •   SWUSking · 2017-08-22 10:11:19 +08:00 · 1838 次点击
    这是一个创建于 2446 天前的主题,其中的信息可能已经有所发展或是发生改变。
    网页代码:
    `
    <head>
    <meta charset="utf-8">
    </head>
    <body>
    <h1>P2L2A</h1>
    <a href="#" onclick="javascript: document.getElementById('submit').click(); return false">link</a>
    <form action="./upload" method="post" style="display: none">
    <input type="text">
    <input id="submit" type="submit">
    </form>
    </body>
    `
    后台代码:
    `
    @post("/upload")
    def upload():
    return static_file("P2L3.html", root=".")
    `

    如果用 Selenium 搭配 PhantomJS 获取跳转的链接依然是 /upload

    我想得到的 URL 为 P2L3.html,因为 /upload 是 POST 才能得到的,而且静态网页就是 P2L3.html
    3 条回复    2017-08-22 15:18:11 +08:00
    bigfei
        1
    bigfei  
       2017-08-22 12:13:39 +08:00 via Android
    关键字:forward 和 redirect
    SWUSking
        2
    SWUSking  
    OP
       2017-08-22 14:39:12 +08:00
    @bigfei 请问大佬说的是哪个函数的参数。我是小白:(
    bigfei
        3
    bigfei  
       2017-08-22 15:18:11 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   830 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:34 · PVG 06:34 · LAX 15:34 · JFK 18:34
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.