Find a named link on the page, then go click it - in Javascript -
i'm using greasekit, needs in javascript, please
what tell human do
click link called < previous opens in new window (in example below, goes page 22, number, needs for specific link)
<table class="v_page_nav" border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <td width="100%">showing 551-575 of 610 results</td> <td> <a href="/wine/newsletter?ie=utf8&page=22" id="pagination-prev-link"> < previous</a>| page:</td> <td class="off"> <a href="/gp/vine/newsletter?ie=utf8&page=1" id="pagination-page-1">1</a> </td> <td>...</td> <td class="off"> <a href="/wine/newsletter?ie=utf8&page=22" id="pagination-page-22">22</a> </td> <td class="on"> <a href="/wine/newsletter?ie=utf8&page=23" id="pagination-page-23">23</a> </td> <td class="off"> <a href="/wine/newsletter?ie=utf8&page=24" id="pagination-page-24">24</a> </td> <td class="off"> <a href="/wine/newsletter?ie=utf8&page=25" id="pagination-page-25">25</a> </td> <td>| <a href="/wine/newsletter?ie=utf8&page=24" id="pagination-next-link">next ></a> </td> </tr> </table> the code:
the last 2 lines of answer probably:
link.target="_blank"; link.click(); (this open link in new window) ..but want know how write rest of code; lines go above it.
note
an alternative finding < previous might link id pagination-prev-link
considering last sentence:
var link = document.getelementbyid('pagination-prev-link');
Comments
Post a Comment