Jump to content
Sign in to follow this  
bundyxc

Finding a link by its href?

Recommended Posts

bundyxc

Here's what I have so far.. (just the basics)

#include <IE.au3>
$oIE =_IECreate("http://google.com",0,1,1)
$o_link = _IEGetObjByName($oIE,"") ; This line isn't right. How do I get the link by where it's pointing to?
_IEAction($o_link,"click")
_IELoadWait ($oIE)
_IEQuit ($oIE)

Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites
Richard Robertson

If you know the href in advance, why can't you just navigate to it?

Share this post


Link to post
Share on other sites
bundyxc

If you know the href in advance, why can't you just navigate to it?

I could navigate to it.. would that work if they did a referrer check?


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites
Richard Robertson

That depends on the site. Just try it.

Share this post


Link to post
Share on other sites
bundyxc

That depends on the site. Just try it.

Nope. "Please use the correct gateway". (a.k.a. "I'm a paranoid freak with referrer checks on every page").

#include <IE.au3>
$oIE =_IECreate("http://infiniteadds.org",0,1,1)
$o_fid = _IEGetObjByName($oIE,"friendid")
$o_submit=_IEGetObjByName($oIE,"action")
_IEFormElementSetValue ($o_fid, "21802680")
_IEAction($o_submit,"click")
_IELoadWait ($oIE)

_IENavigate($oIE, "http://infiniteadds.org/addvip2.php?fid=21802680&addid=112997804&key=c52092001e5c5a42679d35884ac1c109")
_IELoadWait ($oIE)
Sleep(5000)
_IEQuit($oIE)

Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites
Richard Robertson

Infiniteadds? What is this site anyways?

Share this post


Link to post
Share on other sites
bundyxc

Infiniteadds? What is this site anyways?

It's a site where I promote a band. With all of the promotions that I run, they get 100+ friend requests per day (which is a lot).


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites
Richard Robertson

So you are trying to bot your advertisements?

Share this post


Link to post
Share on other sites
bundyxc

hmmm.. yes? It's not against the ToS. You can log in every 30 minutes to be added to the list of people to be added. So.. instead of doing it myself, I just make a bot to do it. I'm not cheating the system or anything. I'm just making it so that I can save time, not cheat them, you know?


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites
Richard Robertson

Ok, that's fine then. I'm not really sure how to find it but I suppose you could find all anchors and look at each one until you find one that matches. Or better yet, does it have an ID?

Edited by Richard Robertson

Share this post


Link to post
Share on other sites
bundyxc

Ok, that's fine then. I'm not really sure how to find it but I suppose you could find all anchors and look at each one until you find one that matches. Or better yet, does it have an ID?

No link ID. Could I just count links, and say to click the 47th link or something?


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites
Richard Robertson

Well, if it's always in the same place, then yes, that should work.

Share this post


Link to post
Share on other sites
bundyxc

Well.. the only problem is this: I know the placement if you count from the bottom.. but not the top. haha.

The link is toward the bottom (let's pretend it's in the footer), so they won't change it.. but they'll change the content above it. Any way to count from the bottom up?

By the way, thanks for answering all of these questions for me. I'm a total noobbbbbbb. :)


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites
Pain

Take a look at _IELinkGetCollection.

A small example:

$oIE = _IE_Example ("basic")
$oLinks = _IELinkGetCollection ($oIE, 0)
$iNumLinks = @extended
MsgBox(0, "Link Info", $iNumLinks & " links found")

$last_link = _IELinkGetCollection($oIE, $iNumLinks - 1); -2 means 2nd last link and so on

MsgBox(0, "Last link is: ", $last_link.href)

Share this post


Link to post
Share on other sites
bundyxc

$oIE = _IE_Example ("basic")

That's where I'd create/navigate an IE window, right?


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites
Pain

Yes that's the handle to the IE object, often a _IECreate.

Share this post


Link to post
Share on other sites
Richard Robertson

The lower part of that example is actually perfect. Good thinking, Pain.

$last_link = _IELinkGetCollection($oIE, $iNumLinks - 1); -2 means 2nd last link and so on

See if this works for you.

Share this post


Link to post
Share on other sites
bundyxc

Thanks. I'll give it a shot. :)

Man, you guys are geniuses with this stuff.


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites
Richard Robertson

I actually know very little about the IE stuff. I am a software developer, a web developer, a Windows automator, but not a web automator. :)

Share this post


Link to post
Share on other sites
bundyxc

I actually know very little about the IE stuff. I am a software developer, a web developer, a Windows automator, but not a web automator. :o

Really? I'm just a sixteen year old kid, trying to balance school, homework, sports, work, and learning stuff on the computer.

No specialties for me. :)


Global $arr[2]

$arr[0]="hip"
$arr[1]="hip"
;^^ hip hip array. ^^

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.