Tons of ways to do this, but are you sure you need to do all that? Script should auto run on each iFrame normally, so I think this applies to regular frames as well although I could be mistaken. Make sure you have the correct include for the URL of the frame you are trying to access
http://epaper.timesofindia.com/Default/Scripting/ArchiveView.asp?Daily=TOIM&login=default&Enter=true&Skin=TOI&GZ=T&AW=1246311215265&AppName=1 Try this for testing - right click - this frame -> show only this frame, will simplify things. Forget inner HTML for something like this using XPATH makes perfect sense... //i...@title='Next Page'] Returns both of the next page button's images (there is a smaller one in the red bar, the second result is the one you were tlking about I think) That string of xpath will get you the nextButton image, so if you do a parentNode on the result (you can probably just use the single result option for document.evaluate) there are tons of examples of this out there, but the parentNode of the image is the link you want, since the image has the nice alt and or title "Next Page" just match that, otherwise it gets more complex. Some examples of how to use document.evaluate http://userscripts.org/topics/26131 https://developer.mozilla.org/en/DOM/document.evaluate On Jun 24, 8:15 am, Siju <[email protected]> wrote: > Hi All, > > I want to access the content of a frame and access an anchor to get > the href (so that I can fire it). > > The webpage has multiple frames and when I try window.document, it > gives one of the window. I tried top.document to get the frame I > wanted, that worked. But when I access > contentDocument.firstChild.innerHTML on that frame, it gives me the > content, but that is not the content I see when I use DOM Inspector. > In DOM Inspector, I can see the anchor element that I want to access > in the frame(mainFrame). > > This is what I use to get the html > top.document.getElementsByName("mainFrame") > [0].contentDocument.firstChild.innerHTML > > MORE DETAILS > ------------------------- > The webpage I try > ishttp://epaper.timesofindia.com/Default/Client.asp?Daily=TOIM&login=de... > > You can see the acnhor, it is the next page link > > and the anchor tag I want to access is in mainFrame > <A href="/Default/Scripting/ArchiveView.asp? > Daily=TOIM&AppName=1&login=default&Enter=true&Skin=TOI&GZ=T&BaseHref=TOIM > %2F2009%2F06%2F24&AW=1245834196578&Page=3"><IMG border="0" > title="Next Page" alt="Next Page" src="/Default/Layout/Images/TOI/ > Buttons/nextPage.gif"/></A> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
