Jump to content

Recommended Posts

Posted

Hey guys,

I am looking for a way to deal with a page that you habitually acces from your Ipod Touch or Any *Touch* phone.

How can I deal with that kind of page using IE.au3 functions..?

http://touch.facebook.com/profile.php?id=639263068

I want to "click" the links but the code is not like a regular HTML page.

Thanks,

Posted

Well lets say, I would like to Click the "Add as Friends" link. How could I do that using Autoit?

It isnt a <a> links at all. It seems to be a <u> link...

Posted

The button you are trying to click is being added dynamically with javascript. It won't show up in the page source, but will be available for DOM.

If you whip out Google Chrome, with it's Developer Tools window, you can right click the button and press "Inspect Element". You'll see the u button is contained in a div named "friendRequestLink" with only one child you can click.

Get div by id

- Get first child element of div

- - Click the first child element of div

Posted (edited)

Thanks Manadar! I didnt see it from that point of view.

How can I get the first child element of a div?

$browser = _IECreate("http://touch.facebook.com/profile.php?id=639263068", 0,1,1,1)
$div = _IEGetObjById ($browser, "friendRequestLink")
$link = _IEFormGetCollection($div, 0) ;Get first child element of div ?
_IEAction($link, "click")

Dieuz,

Edited by Dieuz
Posted (edited)

Thanks manadar!

The thing is that even with this function, I cant get it to work. There is no way to click the "Add as Friends" link.

The requested action with this object has failed.:
$o_object.Click()
$o_object.Click()^ ERROR

#include <IE.au3>
#include <Array.au3>
#Include <File.au3>

$browser = _IECreate("http://touch.facebook.com/profile.php?id=639263068", 0,1,1,1)
$div = _IEGetObjById ($browser, "friendRequestLink")
$link = _IETagNameGetCollection($div, 0)
_IEAction($link, "click")

Any workaround?

Edited by Dieuz
Posted

Maybe it is not the first DIV ? Get them all and them loop each of them to identify which one you need.

We are all guessing here so maybe you post the source of the page?

Posted

<html>
  <head>
  <title>Welcome to Facebook | Facebook</title><meta name="description" content="Facebook helps you connect and share with the people in your life." /><meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />  <link type="text/css" rel="stylesheet" href="http://static.ak.fbcdn.net/rsrc.php/zFTXM/hash/73wima7f.css" />
  <link type="text/css" rel="stylesheet" href="http://b.static.ak.fbcdn.net/rsrc.php/z706Q/hash/36oceff8.css" />
</head><body onload="setTimeout(scrollTo, 0, 0, 1)">
  <body home="home.php">
    <div id="topbar">
      <u class="logo">
        <img src="http://static.ak.fbcdn.net/rsrc.php/z36YT/hash/dvep9po1.png" />
      </u>
    </div>
  <div class="login_form">
    <form id="login_form" action="https://login.facebook.com/login.php?iphone=1&next=http%253A%252F%252Ftouch.facebook.com%252F" method="post">
      <div class="login_form_label">Email or Phone:</div>
      <input class="login_form_field" type="text" name="email" value="">
      <div class="login_form_label">Password:</div>
      <input class="login_form_field" type="password" name="pass">
      <input type="hidden" name="next" value="http://touch.facebook.com/">
      <u onclick="document.getElementById('login_form').submit()"
        class="button" name="login">Login</u>
      </form>
    </div><div class="login_left"><a href="http://m.facebook.com/r.php">Sign up</a></div><div class="login_center"><a href="http://m.facebook.com/reset.php">Forgot your password?</a><div class="login_right"><a href="http://www.facebook.com/login.php?m2w">Full site</a> </div>
  <script type="application/x-javascript">
  var path = window.location.pathname;
  if (path != "/login.php" && path != "/login_post.php")
    window.location = "/login.php";
  </script>
</body>
</html>

Posted

This looks like the log in page source. I dont see any "add as friend" part.

Don't know then, It wouldn't let me view the source through chrome, so thats just InetGet and then putting the file contents on the clipboard. Maybe it ignores the "id=****" part of the url.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...