Comments (7)
The other possibility is that ksb._kvc
never appears on the page sometimes.
Definitely not this. I also had to bump up my time to 2 seconds, which seems to be working much better.
from images-scraper.
Thanks for finding this issue @ururk
I think it would be better to wait for page load. That can be achieved by doing this as part of the goto
.
await page.goto(query.replace('%', encodeURIComponent(self.keyword)), {
waitUntil: 'networkidle0'
});
from images-scraper.
Great! I'm still getting the same issue though - page loads but does not find any results. What I've found, is every time this happens, the meta JSON dos not load on the page (no .rg_meta
element) nor are there any .rg_l
elements. I see some errors in the web browser console:
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'report-sample' 'nonce-5fBQzWdGZVpdbsJiddVttw' 'unsafe-inline'". Note that 'unsafe-inline' is ignored if either a hash or nonce value is present in the source list.
addScriptContent @ VM52 __puppeteer_evaluation_script__:7
No network errors, though, so I'm at a slight loss as to why this is happening. I even tried updating to the latest puppeteer (which includes a newer Chromium) and am still having problems.
from images-scraper.
Thanks for investigating @ururk . I can't seem to reproduce it
The error you see might be resolved by doing this: https://github.com/puppeteer/puppeteer/blob/master/docs/api.md#pagesetbypasscspenabled
Can you please try? Thanks, I'm reopening this issue.
from images-scraper.
I managed to reproduce it @ururk . I think this fixes it. I'm pushing it to a new version shortly.
from images-scraper.
This appears to fix it - I'll run some test searches and let you know how it goes.
from images-scraper.
I've done about 50 searches - this fixes the problem! I still have random Chromium crashes, but I don't think it's related to this node module's code.
from images-scraper.
Related Issues (20)
- 400 images limit HOT 1
- Webpack issues
- I think you're calling the function twice here. Could it be? HOT 1
- Library No Longer Functions: example no longer returns results HOT 1
- Parsing page for image link broken HOT 3
- "Failed to launch the browser process" on Ubuntu HOT 4
- bypassable safe mode by final user HOT 2
- Add Typescript definitions
- Only Sending One Image HOT 2
- Issue adding options to constructor HOT 1
- Stop image scraping immediately when there are no results HOT 3
- Add support for puppeteer-core HOT 1
- Only allow png and jpg HOT 1
- Add a filter for nsfw words HOT 5
- Slow HOT 1
- Timeout Error HOT 2
- Error with heroku
- The "url" argument must be of type string. Received undefined HOT 7
- puppeteer doesn't install HOT 1
- The scraper is getting stuck on the "Accept Cookies" page of google HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from images-scraper.