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

Specific site work with deno but not node #372

Open
mirsella opened this issue Oct 11, 2023 · 7 comments
Open

Specific site work with deno but not node #372

mirsella opened this issue Oct 11, 2023 · 7 comments

Comments

@mirsella
Copy link

hello !

i opened #368 for the exact reverse reason last week, this time the deno example works but not node 🙃

https://reporterre.net/Arnaud-Begin-l-inspecteur-nucleaire-qu-EDF-veut-faire-taire
getting

{
  "error": 1,
  "message": "Request failed with error code 403",
  "data": null,
  "meta": {
    "service": "article-parser",
    "lang": "javascript",
    "server": "express",
    "platform": "node"
  }
}
@ndaidong
Copy link
Collaborator

Yes, it seems the examples need to be updated now (node, ts-node and bun).

Not sure about the root cause. Maybe some updates from Node's built-in fetch module?

However regular usage still works for me.

Screenshot from 2023-10-12 08-16-54

@mirsella
Copy link
Author

what do you mean "regular usage work" ? by passing a url directly into extract ? or passing a html doc into extraxthtml ?

@sylvesteraswin
Copy link

Is there an update on this issue? I am also facing a similar Error: Request failed with error code 403 in node 20.

@Finalet
Copy link

Finalet commented May 6, 2024

I'm getting 403 on this specific url https://www.politico.com/news/2024/05/04/republicans-state-department-investigations-00156077 on my machines.

Your demo website seems to fetch it just fine though.

@ndaidong
Copy link
Collaborator

ndaidong commented May 7, 2024

@Finalet 403 Forbidden error means that your request has been denied by target server. Maybe the server (location) where your script runs is currently blocked. Using a proxy service can help. My demo website works because it's located in a region that isn't blocked.

@ndaidong ndaidong closed this as completed May 7, 2024
@mirsella
Copy link
Author

mirsella commented May 7, 2024

@ndaidong the original issue was about it working with the deno version but not the node one, both on the same network

@mirsella
Copy link
Author

mirsella commented May 7, 2024

just re tested:

  • node doesn't work
  • bun works
  • deno:
Task dev deno run --allow-net --allow-env --allow-read index.ts
error: Import 'https://esm.sh/v135/https:@latest/denonext//deno.land/x/deno_dom@v0.1.45/deno-dom-wasm.ts.js' failed: 400 Bad Request
    at https://esm.sh/@extractus/article-extractor@8.0.9:4:8
  • tsnode works

@ndaidong ndaidong reopened this May 7, 2024
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

4 participants