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

Import to ReactJs #302

Open
nxvinh222 opened this issue Nov 26, 2021 · 4 comments
Open

Import to ReactJs #302

nxvinh222 opened this issue Nov 26, 2021 · 4 comments

Comments

@nxvinh222
Copy link

nxvinh222 commented Nov 26, 2021

I'm trying to create a scraping extension using ReactJs but i can't find anywhere that how to import this library via code. I tried to run the script in the docs but it's not working at all.
I would be grateful if anyone can help me how to import this.
/-/-/-/
image

@Yomguithereal
Copy link
Member

Yomguithereal commented Nov 26, 2021

Hello @nxvinh222 you should propbably check out how I did to inject artoo in PhantomJS for instance: https://github.com/medialab/sandcrawler/blob/master/phantom/bindings.js#L59-L90. This should be close to what you want to achieve. Note that artoo was born at a time where packaging JS code wasn't even a thing, so it might be a bit hairy to adapt to newer schemes.

@nxvinh222
Copy link
Author

@Yomguithereal wow thank you for your answer.
I'm trying to make a scrape chrome extension and I'm wondering should I run the scrape step via the API to my server(using Scrappy, Puppeteer) or run it directly in the browser(artoo, jQuery). Can you give me some advice, thank you so much.

@Yomguithereal
Copy link
Member

It depends on so much that I cannot give you a proper answer. I would say that if you need to scrape things as they appear on the user's screen you should probably do so on the client side. This is even more true if you are scraping pages where you need to authenticate or perform complex interactions or interact with complex public-facing APIs.

@nxvinh222
Copy link
Author

@Yomguithereal Thank you so much, I appreciate your guidance.

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

2 participants