/    Sign up×
Community /Pin to ProfileBookmark

turning getElementsByTagName into XPath

So I have this xpath evaluate with these following variables:

[CODE] var i, highestValue = boss.preferences.bounty_min, correspondingInput;
var inputs = document.evaluate(“//input[@value=’attack’]”, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);[/CODE]

to search for the target I want which outputs to

[CODE]correspondingInput = inputs.snapshotItem(i);[/CODE]

How do I convert the next items and use them from the variable: correspondingInput

[CODE] var target_id = divs[i].getElementsByTagName(‘INPUT’)[12].value;
var bounty_id = divs[i].getElementsByTagName(‘INPUT’)[13].value;
[/CODE]

A second question is how do I use Firebug to find the full url for a button like this url. I see the input type elements but not the completed url for that button.

[CODE]‘http://apps.facebook.com/mobwars/fight/do.php?action=attack_bounty&target_id=’+target_id+’&bounty_id=’+bounty_id+’&from=/hitlist/index.php’;[/CODE]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @chrisdab spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...