@monostate/node-scraper 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/index.js +11 -4
  3. package/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 BNCA Team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/index.js CHANGED
@@ -398,13 +398,17 @@ export class BNCASmartScraper {
398
398
  /__webpack_require__/i
399
399
  ];
400
400
 
401
- // Check for protection systems
401
+ // Check for protection systems (more specific patterns)
402
402
  const protectionIndicators = [
403
- /cloudflare/i,
403
+ /cloudflare.*challenge/i,
404
+ /cloudflare.*protection/i,
405
+ /ray id.*cloudflare/i,
404
406
  /please enable javascript/i,
405
407
  /you need to enable javascript/i,
406
408
  /this site requires javascript/i,
407
- /jscript.*required/i
409
+ /jscript.*required/i,
410
+ /security check.*cloudflare/i,
411
+ /attention required.*cloudflare/i
408
412
  ];
409
413
 
410
414
  // Check for minimal content (likely SPA)
@@ -448,7 +452,10 @@ export class BNCASmartScraper {
448
452
  if (/window\.__NEXT_DATA__/i.test(html)) {
449
453
  indicators.push('Next.js data detected');
450
454
  }
451
- if (/cloudflare/i.test(html)) {
455
+ if (/cloudflare.*challenge/i.test(html)) {
456
+ indicators.push('Cloudflare challenge detected');
457
+ }
458
+ if (/cloudflare.*protection/i.test(html)) {
452
459
  indicators.push('Cloudflare protection detected');
453
460
  }
454
461
  if (/please enable javascript/i.test(html)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monostate/node-scraper",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Intelligent web scraping with multi-level fallback system - 11.35x faster than Firecrawl",
5
5
  "type": "module",
6
6
  "main": "index.js",