推荐学习书目
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 · Aug 22, 2017 · 2257 views
    This topic created in 3185 days ago, the information mentioned may be changed or developed.
    网页代码:
    `
    <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 replies    2017-08-22 15:18:11 +08:00
    bigfei
        1
    bigfei  
       Aug 22, 2017 via Android
    关键字:forward 和 redirect
    SWUSking
        2
    SWUSking  
    OP
       Aug 22, 2017
    @bigfei 请问大佬说的是哪个函数的参数。我是小白:(
    bigfei
        3
    bigfei  
       Aug 22, 2017
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6019 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 02:01 · PVG 10:01 · LAX 19:01 · JFK 22:01
    ♥ Do have faith in what you're doing.