2007年01月04日 星期四 19:46
²»ÊÇ,ÎÒÊÇ·Ö¿ª²âÊ﵀ ----- ÔʼÓʼþ ---- ·¢¼þÈË£º Gao Hong <joy.highland在gmail.com> ÊÕ¼þÈË£º python-chinese在lists.python.cn ÒÑ·¢ËÍ£º 2007/1/4(ÖÜËÄ), ÏÂÎç6:08:18 Ö÷Ì⣺ Re: [python-chinese] Çó½ÌpythonÈçºÎ¿ØÖÆframeÖеÄÎı¾Á´½Ó ÊDz»Êǵã»÷ͼƬ֮ºó£¬Ò³Ãæ¾ÍÇл»ÁËÄØ£¿ ÔÚ07-1-4£¬yu jiang <xiaoyu_ro在yahoo.com.cn> дµÀ£º ½üÈÕÔÚÍøÉÏÕÒµ½¸ö½ÐcPAMIEµÄÄ£¿é,Æ书ÄÜÊǶÔÍøÒ³½øÐÐ×Ô¶¯²Ù×÷. ÊÔ×ÅÓÃÁËϸоõ²»´í,µ«ÔÚ¶Ô´ø¿ò¼ÜµÄÍøÒ³½øÐвÙ×÷ʱÅöµ½Ò»µãÎÊÌâ. ʵÑé²½ÖèÈçÏÂ: ÏÖÓÐÒ»ÍøÒ³,ÃûΪ:test.htm.·Ö"leftFrame"ºÍ"mainFrame"Á½¸ö¿ò¼Ü. ʵÑéÄ¿µÄ:ʵÏÖ×Ô¶¯µã»÷leftFrameÖеÄIDΪimg_000100000µÄͼƬºÍÃûΪ"login"µÄÎı¾Á´½ÓµÄ¹¦ÄÜ. Python´úÂëÈçÏÂ: # -*- coding: cp936 -*- from cPAMIE import PAMIE ie=PAMIE() ie.navigate("http://localhost/aspnet/test.html ") leftframe = ie.frameGet("leftFrame") ie.imageClick(leftframe.img_000100000) ie.linkClick(leftframe.login) ½á¹û:×Ô¶¯µã»÷ͼƬ³É¹¦,µã»÷Îı¾Á´½Óʧ°Ü,Çë½Ì¸ßÊÖÖ¸½Ì! __________________________________________________ ¸Ï¿ì×¢²áÑÅ»¢³¬´óÈÝÁ¿Ãâ·ÑÓÊÏä? http://cn.mail.yahoo.com _______________________________________________ python-chinese Post: send python-chinese在lists.python.cn Subscribe: send subscribe to python-chinese-request在lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese -- It's a long journey to go! _______________________________________________ python-chinese Post: send python-chinese在lists.python.cn Subscribe: send subscribe to python-chinese-request在lists.python.cn Unsubscribe: send unsubscribe to python-chinese-request在lists.python.cn Detail Info: http://python.cn/mailman/listinfo/python-chinese __________________________________________________ ¸Ï¿ì×¢²áÑÅ»¢³¬´óÈÝÁ¿Ãâ·ÑÓÊÏä? http://cn.mail.yahoo.com -------------- 下一部分 -------------- Ò»¸öHTML¸½¼þ±»ÒƳý... URL: http://python.cn/pipermail/python-chinese/attachments/20070104/66d435ed/attachment.html
2007年01月05日 星期五 09:07
On 1/4/07, yu jiang <xiaoyu_ro在yahoo.com.cn> wrote: > > 不是,我是分开测试的 > > > > > > 近日在网上找到个叫cPAMIE的模块,其功能是对网页进行自动操作. > > 试着用了下感觉不错,但在对带框架的网页进行操作时碰到一点问题. > > > > 实验步骤如下: > > > > 现有一网页,名为:test.htm.分"leftFrame"和"mainFrame"两个框架. > > > > > 实验目的:实现自动点击leftFrame中的ID为img_000100000的图片和名为"login"的文本链接的功能. > > > > Python代码如下: > > # -*- coding: cp936 -*- > > from cPAMIE import PAMIE > > ie=PAMIE() > > ie.navigate("http://localhost/aspnet/test.html ") > > leftframe = ie.frameGet("leftFrame") > > ie.imageClick(leftframe.img_000100000) > > ie.linkClick(leftframe.login) > > > > 结果:自动点击图片成功,点击文本链接失败,请教高手指教! 这个问题确实有,会不会通过名字无法获得? 如果是一个没有ID的图像链接能处理吗? -- with kind regards
Zeuux © 2025
京ICP备05028076号