Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not usable on windows (cmd.exe) #79

Open
e-d-n-a opened this issue Aug 16, 2017 · 2 comments
Open

Not usable on windows (cmd.exe) #79

e-d-n-a opened this issue Aug 16, 2017 · 2 comments

Comments

@e-d-n-a
Copy link

e-d-n-a commented Aug 16, 2017

I really like the simple design of this tool and thought using it would be straight forward.
But I tried several kind of selectors, but with almost no success.

OK, I only tried with one html file so far, but at least pup has formated/pretty-printed it correctly, so parsing should work fine, I guess.

As mentioned in Issue 54 single quotes mostly do not work on windows.
I could only filter out something with simple tag selectors using double quotes (e.g. "meta", "head").
Most of the times it does not output anything!

Selector parsing error: Malformed 'contains("")' selector
Using :contains("") always throws an error, no matter how I try to use it.
The source code (selector.go) seems to do this on (for the user) various non-distinguishable cases.

Does anyone use this tool on windows? Is there a trick or does it just not work properly?

@jaraco
Copy link

jaraco commented Mar 2, 2018

cmd.exe is an old and clumsy tool. I suggest instead using PowerShell, a much more powerful shell for Windows... or if you must, get a Unix-like shell (bash or similar). It probably is possible to write native cmd-compatible commands, but you'll have to get the escape sequences and syntax just right, and in my experience (as a long-time Windows enthusiast), it's just not worth it.

@danielrippa
Copy link

danielrippa commented Oct 8, 2020

What worked for me was escaping quotes with \ as in: \"

Working example:
type rss.html | pup script:contains(\"channel\")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants