Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

does phantomcss selector support the xpath? #163

Open
qileilove opened this issue May 19, 2016 · 5 comments
Open

does phantomcss selector support the xpath? #163

qileilove opened this issue May 19, 2016 · 5 comments

Comments

@qileilove
Copy link

If inscribe, troublesome everybody.

@jamescryer
Copy link

CasperJS supports XPath, http://docs.casperjs.org/en/latest/selectors.html#selectors which is what PhantomCSS uses to capture screenshots of html components.

@qileilove
Copy link
Author

@jamescryer thanks,but like the phantomcss.screenshot('#the-dialog', 'a screenshot of my dialog') function, the first parameter must be css selector, can't use xpath selector.

@jamescryer
Copy link

I'm happy to review a Pull Request for the support of XPath

@xiaoina
Copy link

xiaoina commented Mar 17, 2017

So the only way to take a screenshot is if something is a div class?

@jamescryer
Copy link

Any CSS selector ".my-class" is the most obvious usage, less obvious might be "[href='http://www.site.com']" or even "div:first-child span .btn" but I would recommend keeping your selectors as small as possible, even if that means adding classes you wouldn't have otherwise needed.

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

No branches or pull requests

3 participants