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

用 IE 打开的网页,如何读取其中的内容

  •  
  •   eric13517 · 2015-07-09 22:46:19 +08:00 · 2193 次点击
    这是一个创建于 3214 天前的主题,其中的信息可能已经有所发展或是发生改变。
    python新手,刚自学,打算先自己做个小工具玩:

    某个只能用IE访问的网页,上面有一些动态变化的信息,我想写个Python小工具,定时检查IE打开的这个页面上的内容,符合一定条件时,在该页面的一个输入框输入一串数字并点击旁边的提交按钮。

    模拟键盘输入和鼠标点击已经会了,但现在不会读取IE打开的页面上的内容,我原以为打开的网页,可以用FindWindowEx查找IE的子窗口的句柄,并从窗口句柄获取信息,但试了下不行,哪位高手指点一下,怎么读取这样的页面中的内容。
    2 条回复    2015-07-09 23:22:32 +08:00
    slimhigh
        1
    slimhigh  
       2015-07-09 22:56:56 +08:00
    你可以尝试用Selenium来做哦。
    http://www.seleniumhq.org/docs/03_webdriver.jsp
    nanlou
        2
    nanlou  
       2015-07-09 23:22:32 +08:00
    selenium watir都可以的。。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2832 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 10:01 · PVG 18:01 · LAX 03:01 · JFK 06:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.