Quantcast

Jump to content


Photo

Deriving a link from an xpath


  • Please log in to reply
2 replies to this topic

#1 Metigue

Metigue
  • 689 posts

Posted 19 November 2010 - 02:25 PM

The link I'm trying to grab varies for each item but always fits under this format:
<a href="javascript:%20void(0);" onclick="if (confirmPurchase(41129)) { document.buy41129.submit() } else { return false; }"><img src="garage.phtml_files/can_blechy_gummies.gif" border="1" height="80" width="80"></a>

This is most definitely contained within my snapshots, I just don't know how to get it out.

I tried
var link = items.snapshotItem(i).getElementsByTagName('a');

But that provided me with the same error I was consistently getting with any other method:
Firefox can't find the file at jar:file:///C:/Program Files (x86)/Mozilla Firefox/chrome/browser.jar!/content/browser/[object XPCNativeWrapper [object HTMLCollection]].

My xpath grabs the TD field of each item.

Any ideas?

#2 artificial

artificial
  • 186 posts


Users Awards

Posted 19 November 2010 - 03:04 PM

document.buy41129.submit()

Does that not mean the form name is buy41129? Just grab the name of the form, and you have the item id.

Edited by Artifeetfetish, 19 November 2010 - 03:04 PM.


#3 Pyro699

Pyro699
  • 1543 posts


Users Awards

Posted 19 November 2010 - 07:31 PM

I made this because of you Metigue

http://pastebin.com/7usGyMhS

please get back to me :)


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users