Clickear un botón en una página web
Acá está la información del Debug Bar (usé lo de arrastrar el objetivo hasta el botón para obtener la región del código):
Código: Seleccionar todo
<A onmouseup="fbjs_sandbox.instances.a17091798008.bootstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,17091798008),function(a17091798008_event) {return a17091798008_yesno('yes','public');},17091798008],new fbjs_event(event));" class="sprite-btn btn-yltk" id=app17091798008_btn_yltk style="DISPLAY: block; COLOR: black; TEXT-DECORATION: none" onclick="(new Image()).src = '/ajax/ct.php?app_id=17091798008&action_type=3&post_form_id=7cda7e16b55446920bb8a2c088668a25&position=3&' + Math.random();fbjs_sandbox.instances.a17091798008.bootstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,17091798008),function(a17091798008_event) {return false;},17091798008],new fbjs_event(event));return true;" href="#" target=_blank fbcontext="3e114efabcd3"><DIV style="FONT-WEIGHT: bold; PADDING-TOP: 5px"><SPAN style="FONT-SIZE: 18px">YES</SPAN><BR>(Let Them Know)</DIV></A>
Código: Seleccionar todo
Object Type DispHTMLElementCollection
Object Count 1613
Characteristics of all HTML Elements on page
HTML ELEMENTS
Index TAG ID EXTRA INFORMATION
1085 A app17091798008_btn_yltk Link Text: YES (Let Them Know)
href: http://apps.facebook.com/areyouinterested/?ref=bm#
Código: Seleccionar todo
Object Type DispHTMLElementCollection
Object Count 221
Characteristics of all 'a' Links
ANCHOR TAGS
index TAG ID EXTRA INFORMATION
161 A app17091798008_btn_yltk Link Text: YES (Let Them Know)
href: http://apps.facebook.com/areyouinterested/?ref=bm#
Probé con este código pero no clickeó el botón:
Código: Seleccionar todo
#include <IE.au3>
$oIE = _IECreate ("http://www.facebook.com/home.php")
$oForm = _IEFormGetCollection ($oIE, 0)
$oUsername = _IEFormElementGetCollection ($oForm, 7)
$oPassword = _IEFormElementGetCollection ($oForm, 8)
_IEFormElementSetValue ($oUsername, "Username")
_IEFormElementSetValue ($oPassword, "Password")
_IEFormSubmit ($oForm)
_IENavigate ($oIE, "http://apps.facebook.com/areyouinterested/?ref=bm")
$oButton = _IEGetObjById ($oIE, "app17091798008_btn_yltk")
_IEAction ($oButton, "click")
Código: Seleccionar todo
#include <IE.au3>
$oIE = _IECreate ("http://www.facebook.com/home.php")
$oForm = _IEFormGetCollection ($oIE, 0)
$oUsername = _IEFormElementGetCollection ($oForm, 7)
$oPassword = _IEFormElementGetCollection ($oForm, 8)
_IEFormElementSetValue ($oUsername, "Username")
_IEFormElementSetValue ($oPassword, "Password")
_IEFormSubmit ($oForm)
_IENavigate ($oIE, "http://apps.facebook.com/areyouinterested/?ref=bm")
$oButton = _IELinkClickByIndex ($oIE, 161)
_IEAction ($oButton, "click")
Código: Seleccionar todo
--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType
+>22:45:34 AutoIT3.exe ended.rc:0
+>22:45:35 AutoIt3Wrapper Finished
>Exit code: 0 Time: 40.163
Código: Seleccionar todo
; *******************************************************
; Example 1 - Open a browser to the basic example, get an object reference
; to the DIV element with the ID "line1". Display the innerText
; of this element to the console.
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("basic")
$oDiv = _IEGetObjById ($oIE, "line1")
ConsoleWrite(_IEPropertyGet($oDiv, "innertext") & @CR)
Código: Seleccionar todo
<DIV class=ayi id=app17091798008_browse_content_area style="DISPLAY: block; TEXT-ALIGN: center" fbcontext="3e114efabcd3" fbjs_instance="18"><TABLE width="100%">
<TBODY>
<TR>
<TD style="WIDTH: 110px"></TD>
<TD>
<DIV style="FONT-WEIGHT: bold; FONT-SIZE: 20px; MARGIN: 5px; COLOR: #c40000; FONT-FAMILY: arial; TEXT-ALIGN: center">Are You Interested?</DIV></TD>
<TD style="WIDTH: 110px"></TD></TR>
<TR>
<TD></TD>
<TD>
<TABLE align=center>
<TBODY>
<TR>
<TD><A onmouseup="fbjs_sandbox.instances.a17091798008.bootstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,17091798008),function(a17091798008_event) {return a17091798008_yesno('yes','private');},17091798008],new fbjs_event(event));" class="sprite-btn btn-ya" id=app17091798008_btn_ya style="DISPLAY: block; COLOR: black; TEXT-DECORATION: none" onclick="(new Image()).src = '/ajax/ct.php?app_id=17091798008&action_type=3&post_form_id=7cda7e16b55446920bb8a2c088668a25&position=3&' + Math.random();fbjs_sandbox.instances.a17091798008.bootstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,17091798008),function(a17091798008_event) {return false;},17091798008],new fbjs_event(event));return true;" href="#" target=_blank fbcontext="3e114efabcd3">
<DIV style="FONT-WEIGHT: bold; PADDING-TOP: 5px"><SPAN style="FONT-SIZE: 18px">YES</SPAN><BR>(Anonymous)</DIV></A></TD>
<TD><A onmouseup="fbjs_sandbox.instances.a17091798008.bootstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,17091798008),function(a17091798008_event) {return a17091798008_yesno('yes','public');},17091798008],new fbjs_event(event));" class="sprite-btn btn-yltk" id=app17091798008_btn_yltk style="DISPLAY: block; COLOR: black; TEXT-DECORATION: none" onclick="(new Image()).src = '/ajax/ct.php?app_id=17091798008&action_type=3&post_form_id=7cda7e16b55446920bb8a2c088668a25&position=3&' + Math.random();fbjs_sandbox.instances.a17091798008.bootstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,17091798008),function(a17091798008_event) {return false;},17091798008],new fbjs_event(event));return true;" href="#" target=_blank fbcontext="3e114efabcd3">
<DIV style="FONT-WEIGHT: bold; PADDING-TOP: 5px"><SPAN style="FONT-SIZE: 18px">YES</SPAN><BR>(Let Them Know)</DIV></A></TD>
<TD><A onmouseup="fbjs_sandbox.instances.a17091798008.bootstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,17091798008),function(a17091798008_event) {return a17091798008_yesno('no','public');},17091798008],new fbjs_event(event));" class="sprite-btn btn-s" id=app17091798008_btn_s style="DISPLAY: block; COLOR: black; TEXT-DECORATION: none" onclick="(new Image()).src = '/ajax/ct.php?app_id=17091798008&action_type=3&post_form_id=7cda7e16b55446920bb8a2c088668a25&position=3&' + Math.random();fbjs_sandbox.instances.a17091798008.bootstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,17091798008),function(a17091798008_event) {return false;},17091798008],new fbjs_event(event));return true;" href="#" target=_blank fbcontext="3e114efabcd3">
<DIV style="FONT-WEIGHT: bold; PADDING-TOP: 12px"><SPAN style="FONT-SIZE: 18px">SKIP</SPAN></DIV></A></TD></TR></TBODY></TABLE></TD>
<TD></TD></TR></TBODY></TABLE>
<TABLE cellPadding=10 align=center>
<TBODY>
<TR>
<TD vAlign=top width=200>
<DIV class=about_me_div style="DISPLAY: block; OVERFLOW: hidden; WIDTH: 200px; TEXT-ALIGN: right">
<DIV id=app17091798008_p_on style="DISPLAY: block; FONT-WEIGHT: bold; FONT-SIZE: 16px; COLOR: #ff0000" fbcontext="3e114efabcd3" fbjs_instance="10">Online Now!</DIV><B><SPAN style="FONT-SIZE: 16px"><SPAN id=app17091798008_p_fbml_n fbcontext="3e114efabcd3" fbjs_instance="1">Rahim</SPAN> <SPAN id=app17091798008_p_ag fbcontext="3e114efabcd3" fbjs_instance="2">26</SPAN><SPAN id=app17091798008_p_g fbcontext="3e114efabcd3" fbjs_instance="3">, M</SPAN><BR><SPAN id=app17091798008_p_ci fbcontext="3e114efabcd3" fbjs_instance="4">Dallas</SPAN><BR><SPAN id=app17091798008_p_st fbcontext="3e114efabcd3" fbjs_instance="5">TX</SPAN><SPAN id=app17091798008_p_co fbcontext="3e114efabcd3" fbjs_instance="6"> / US</SPAN></SPAN><BR><BR><A id=app17091798008_p_fpl onclick="(new Image()).src = '/ajax/ct.php?app_id=17091798008&action_type=3&post_form_id=7cda7e16b55446920bb8a2c088668a25&position=3&' + Math.random();fbjs_sandbox.instances.a17091798008.bootstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,17091798008),function(a17091798008_event) {return a17091798008_browse_full_profile($FBJS.ref(this));},17091798008],new fbjs_event(event));return true;" href="#" target=_blank fbcontext="3e114efabcd3">[View More Pics And Profile]</A> <BR><BR><A id=app17091798008_p_sm onclick="(new Image()).src = '/ajax/ct.php?app_id=17091798008&action_type=3&post_form_id=7cda7e16b55446920bb8a2c088668a25&position=3&' + Math.random();fbjs_sandbox.instances.a17091798008.bootstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,17091798008),function(a17091798008_event) {return a17091798008_browse_send_message($FBJS.ref(this));},17091798008],new fbjs_event(event));return true;" href="#" target=_blank fbcontext="3e114efabcd3">[Send Gift/Message]</A> <BR><BR>About Me </B><BR><SPAN id=app17091798008_p_am fbcontext="3e114efabcd3" fbjs_instance="7"><SPAN fbjs_instance="8">Click YES on me!</SPAN></SPAN></DIV></TD>
<TD class=centered vAlign=top width=210>
<DIV style="OVERFLOW: hidden; WIDTH: 210px"><SPAN id=app17091798008_p_fbml_ni fbcontext="3e114efabcd3" fbjs_instance="0"><IMG title="" alt="" src="http://profile.ak.fbcdn.net/v224/1174/113/n100000119166733_5751.jpg" uid="100000119166733" linked="no" size="n"></SPAN></DIV></TD>
<TD class=centered vAlign=top width=105>
<DIV style="MARGIN-TOP: 15px">Upcoming<BR>
<DIV style="OVERFLOW: hidden; WIDTH: 105px"><SPAN id=app17091798008_p_fbml_nis fbcontext="3e114efabcd3" fbjs_instance="16"><IMG title="" alt="" src="http://profile.ak.fbcdn.net/v22939/1857/124/n100000197378426_9000.jpg" width=100 uid="100000197378426" linked="no" size="n"></SPAN></DIV></DIV></TD></TR></TBODY></TABLE><BR><BR><FONT size=1><A id=app17091798008_p_ru onclick="(new Image()).src = '/ajax/ct.php?app_id=17091798008&action_type=3&post_form_id=7cda7e16b55446920bb8a2c088668a25&position=3&' + Math.random();fbjs_sandbox.instances.a17091798008.bootstrap();return fbjs_dom.eventHandler.call([fbjs_dom.get_instance(this,17091798008),function(a17091798008_event) {return a17091798008_browse_ru();},17091798008],new fbjs_event(event));return true;" href="#" fbcontext="3e114efabcd3">[Report]</A></FONT> </DIV>