Adding invisible iframe is one fine method. However, for greater flexibility
and as a better practice, I prefer *GM_xmlhttpRequest*.
More details here:
http://wiki.greasespot.net/GM_xmlhttpRequest

<http://wiki.greasespot.net/GM_xmlhttpRequest>The good point with this is
you can use it even if the page you need is available on a post request
(iframe only works for a get request). Also, its asynchronous, and is event
driven, so a much cleaner approach is possible.

-Kiran

On Sat, Aug 15, 2009 at 2:02 PM, ghagerer <[email protected]> wrote:

>
> the line "iframe.location.href = link;" should be
> "iframe.location.href = linkToBookDetails;".
>
> On Aug 15, 10:30 am, ghagerer <[email protected]> wrote:
> > Hi,
> >
> > I like the iFrame method for that.
> >
> > At first, after you have searched for something on amazon.com, you
> > have to create an invisible iFrame somewhere in the document. One can
> > find howtos for that on the web. Let's call the iFrame iframe.
> >
> > Then I would probably suggest something similar to the following code:
> >
> > oneResult=document.getElementById("result_"+0);
> >
> > while(oneResult != null) {
> >   linkToBookDetails = oneResult.lastChild.firstChild.getAttribute
> > ("href");
> >   iframe.location.href = link;
> >   publisher = parseThePublisher(); // parse it out of iframe.document
> >   // here you can add the publisher to the main-document
> >   oneResult=document.getElementById("result_"+i);
> >   i++;
> >
> > }
> >
> > I would parse the publisher with the XPath: /html/body/div[3]/table[2]/
> > tbody/tr/td/div/ul/li[3]. Probably that's the easiest way. If you
> > don't know how to deal with that look tohttps://
> developer.mozilla.org/en/Introduction_to_using_XPath_in_JavaS....
> > Maybe that helps ^^.
> >
> > Regards,
> > Gerhard
> >
> > On Aug 15, 5:19 am, Giant <[email protected]> wrote:
> >
> > > I am attempting to write a script on my own, but it is not coming out
> > > so well. My idea is a simple one (I think). I work for a publications
> > > company and often use amazon to check publication information on a
> > > given book. Normally, when you search for an ISBN number it returns a
> > > single listing (maybe more) with limited information about the book.
> > > In order to find out who publishes the book I need to click on the
> > > title and scroll down to the "Product Details" section. All I would
> > > like to do is copy the publisher name to the results page. How would
> > > one go about accomplishing this?
> >
> > > Thanks in advance!
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to