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

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

  •  
  •   kfengc27 ·
    kfengc27 · 2015-11-02 23:06:13 +08:00 · 2628 次点击
    这是一个创建于 3099 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    7 条回复    2015-11-03 08:39:04 +08:00
    leavic
        1
    leavic  
       2015-11-02 23:18:45 +08:00
    所以你已经成功的利用 python 提交了这个主题?
    kfengc27
        2
    kfengc27  
    OP
       2015-11-02 23:31:45 +08:00
    @leavic hahahhah 还没打完 女朋友打电话来 就忘记写下面的问题啦~~
    Joway
        3
    Joway  
       2015-11-02 23:40:54 +08:00
    2333
    kfengc27
        4
    kfengc27  
    OP
       2015-11-02 23:41:26 +08:00
    问题是我在用 Python 的 request 库模拟浏览器登陆一个页面的时候发生的。那个页面有几个连续的页面是需要提交表单的,我模拟浏览器从起始页面到第二个页面,我 POST 了数据,成功跳转到了第二页;但是第二页跳转到第三页的时候我也同样 POST 了相关数据,但是返回的页面 URL 不是第三页的 URL ,或者出现 ERROR 54 Connection by peers > < 我保持了 cookie 和提供了正确的 header,google 并没有 google 到解决方案,不知道这是什么原因导致的,大家有什么建议吗
    junnplus
        5
    junnplus  
       2015-11-03 01:28:57 +08:00 via Android
    表格?表单?
    tdifg
        6
    tdifg  
       2015-11-03 08:15:00 +08:00
    @kfengc27 有代码啥的吗
    zjxubinbin
        7
    zjxubinbin  
       2015-11-03 08:39:04 +08:00
    这个回复是我用 Phantomjs+Selenium 回复的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3092 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 13:48 · PVG 21:48 · LAX 06:48 · JFK 09:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.