0

I'm using Ghost for Python 2.7 and I'm trying to click in a link which is in a table. The problem is that I have no ID, name... This is the HTML code:

              <table id="table_webbookmarkline_2" cellpadding="4" cellspacing="0" border="0" width="100%">
                <tr valign="top">
                  <td>
                    <a href="/dana/home/launch.cgi?url=.ahuvs%3A%2F%2Fhq0l5458452ERA-w-Xz8G3LKe8JNM%2F.ISDXWXaWXUivecOc"                          target="_blank" onClick='javascript:openBookmark(
                                                this.href, "yes", "yes");
                                                return false;'                            ><img src="/dana-cached/imgs/icn18x18WebBookmarkPop.gif" alt="This will open in a new TAB" width="18" height="18" border="0"                        ></a>
                  </td>
                  <td width="100%" align="left">
                    <a href="/dana/home/launch.cgi?url=.ahuvs%3A%2F%2Fhq0l5458452ERA-w-Xz8G3LKe8JNM%2F.ISDXWXaWXUivecOc"                            target="_blank" onClick='JavaScript:openBookmark(
                                                this.href, "yes", "yes");
                                                return false;'                              ><b>**LINK WHERE I WANT TO CLICK**</b>                            </a><br><span class="cssSmall"></span>
                  </td>
                </tr>
              </table>

How can I click in this kind of link ?

Ralk
  • 443
  • 1
  • 6
  • 17

1 Answers1

0

Seems like Ghost's Session.click() takes a CSS selector. Here only the table has an ID, so a selector that takes the second td that is a descendant of that ID and finds the a element should work:

session.click('#table_webbookmarkline_2 td:nth-child(2) a')
Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895