推荐学习书目
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
kfengc27
V2EX  ›  Python

Python 模拟浏览器表格提交问题

  •  
  •   kfengc27 ·
    kfengc27 · Nov 2, 2015 · 3391 views
    This topic created in 3872 days ago, the information mentioned may be changed or developed.

    [#模拟浏览器表格提交问题]
    Python 模拟浏览器表格提交问题

    7 replies    2015-11-03 08:39:04 +08:00
    leavic
        1
    leavic  
       Nov 2, 2015
    所以你已经成功的利用 python 提交了这个主题?
    kfengc27
        2
    kfengc27  
    OP
       Nov 2, 2015
    @leavic hahahhah 还没打完 女朋友打电话来 就忘记写下面的问题啦~~
    Joway
        3
    Joway  
       Nov 2, 2015
    2333
    kfengc27
        4
    kfengc27  
    OP
       Nov 2, 2015
    问题是我在用 Python 的 request 库模拟浏览器登陆一个页面的时候发生的。那个页面有几个连续的页面是需要提交表单的,我模拟浏览器从起始页面到第二个页面,我 POST 了数据,成功跳转到了第二页;但是第二页跳转到第三页的时候我也同样 POST 了相关数据,但是返回的页面 URL 不是第三页的 URL ,或者出现 ERROR 54 Connection by peers > < 我保持了 cookie 和提供了正确的 header,google 并没有 google 到解决方案,不知道这是什么原因导致的,大家有什么建议吗
    junnplus
        5
    junnplus  
       Nov 3, 2015 via Android
    表格?表单?
    tdifg
        6
    tdifg  
       Nov 3, 2015
    @kfengc27 有代码啥的吗
    zjxubinbin
        7
    zjxubinbin  
       Nov 3, 2015
    这个回复是我用 Phantomjs+Selenium 回复的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   947 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 19:51 · PVG 03:51 · LAX 12:51 · JFK 15:51
    ♥ Do have faith in what you're doing.