Skip to content
This repository has been archived by the owner on Jun 20, 2020. It is now read-only.

Using jQuery instead of querySelector on Tab #65

Closed
yazer79 opened this issue Sep 17, 2019 · 1 comment
Closed

Using jQuery instead of querySelector on Tab #65

yazer79 opened this issue Sep 17, 2019 · 1 comment

Comments

@yazer79
Copy link

yazer79 commented Sep 17, 2019

Hi!
I am trying to use jQuery in the tab click instead of querySelector, is this possible?
await tab.click($(div:contains('John'))
I get
$ is not defined
jquery is injected before this click line and working well with the scrape after this

@paps
Copy link
Member

paps commented Sep 17, 2019

That is because you're in the node context here. $ will only be available in an evaluate() call (because then the function is sent to chrome to be executed in the page, where $ was injected)

@paps paps closed this as completed Sep 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants