javascript - How to search href and open part of url -



javascript - How to search href and open part of url -

given illustration html gm script runs on, want create code captures id http://www.mycharactersid.com/id=234223

after javascript got 234223, , other id's on page. open them different link in new tabs. mean id's in html.

example: window.open("http://www.mycharactersid.com/talkid=234223").

burada takılan <b>12</b> karakter bulunmaktadır.<br><br> <table border="0" cellpadding="2" cellspacing="0" width="400"> <tbody><tr> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=1858480">alexandra&nbsp;anthony</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr class="darkcolumnhl"> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=2624518">igor&nbsp;arnaudov</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=1318025">ashanti&nbsp;dunn</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr class="darkcolumnhl"> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=621305">abigail&nbsp;eliopoulos</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=1853122">fynn linus&nbsp;hargasser</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr class="darkcolumnhl"> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=2347156">sabela&nbsp;hernani</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=595514">maaja&nbsp;jürisson</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr class="darkcolumnhl"> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=1329193">sixtine&nbsp;karakaya</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=156315">umut&nbsp;koç</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr class="darkcolumnhl"> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=821852">shanice&nbsp;manning</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=393396">demircan&nbsp;Özdal</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> <tr class="darkcolumnhl"> <td width="234">&nbsp; <a href="characterdetails.asp?action=view&amp;characterid=550724">mélodie&nbsp;stavropoulos</a> </td> <td align="right" width="158"> &nbsp; </td> </tr> </tbody></table> <br> not: en fazla 100 karakter listelenmektedir.<br><br>

thank you.

here's finish gm script work.

note opens new tabs @ once. open sequentially, you'd need queue them in this answer.

// ==userscript== // @name _open lots of tabs // @include http://mycharactersid.com/your_path/* // @include http://www.mycharactersid.com/your_path/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js // ==/userscript== $("td > a[href*='characterid']").each ( function () { var id = this.href.match (/characterid=(\d+)$/i); if (id && id.length > 1) { id = id[1]; window.open ("http://www.mycharactersid.com/talkid=" + id, "_blank"); } } );

javascript firefox greasemonkey

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -