Skip to content

Bug? Selector parsing error: Expected selector indicator after ']' #160

Open

Description

@lorenzogrv

Hi there, and thx for this awesome tool.

While developing an html <table> to JSON extractor, I've found something that seems a bug. I could share here the original HTML source, but I think it's better to provide a simplified example:

# HTML to exemplify
cat >input.html <<HTML
<table>
  <tr>
    <th>X</th>
    <th>Y</th>
  </tr>
  <tr>
    <td>0</td>
    <td>0</td>
  </tr>
  <tr>
    <td colspan="2">Hey, Let's break your ninja script</td>
  </tr>
  <tr>
    <td>1</td>
    <td>0</td>
  </tr>
</table>
HTML
# works as expected
$ <input.html pup 'table tr:not(:parent-of([colspan])) json{}'
# But fails when combined
$ <input.html  pup 'table tr:not(:parent-of([colspan])):not(:parent-of(th))'
Selector parsing error: Unmatched open brace '['
$ pup --version
0.4.0
$ uname -srvpio
Linux 5.4.0-84-generic #94~18.04.1-Ubuntu SMP Thu Aug 26 23:17:46 UTC 2021 x86_64 x86_64 GNU/Linux

Please let me know if I can help adding a test case.
L.

Activity

  1. Anshuman-bansal commented on Sep 26, 2021

    @Anshuman-bansal

    it is not installing on mac i have installed go and brew both and used both way but error comes
    Screenshot 2021-09-26 at 10 25 34 PM

  2. lorenzogrv commented on Sep 29, 2021

    @lorenzogrv
    Author

    it is not installing on mac i have installed go and brew both and used both way but error comes (image omited)

    @objectgrind I'm pretty sure your problem is not related to this particular issue I've opened

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions