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

Unable to create json file #5

Open
rish-hyun opened this issue Dec 28, 2021 · 3 comments
Open

Unable to create json file #5

rish-hyun opened this issue Dec 28, 2021 · 3 comments

Comments

@rish-hyun
Copy link

I have cloned the repo and ran test.py but it throws this error

/content/iww/iww/extractor/resources_extractor.js https://stackoverflow.com/questions/66102275/commanderjs-i-cant-get-value-from-option /content/iww/test.json
internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'puppeteer'
Require stack:
- /content/iww/iww/extractor/resources_extractor.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/content/iww/iww/extractor/resources_extractor.js:1:19)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/content/iww/iww/extractor/resources_extractor.js' ]
}
Traceback (most recent call last):
  File "/content/iww/test.py", line 21, in <module>
    dm.retrieve_DOM_tree("./test.json")
  File "/content/iww/iww/utils/dom_mapper.py", line 44, in retrieve_DOM_tree
    file = open(self.DOM_file_path, 'r', encoding = 'UTF-8')
FileNotFoundError: [Errno 2] No such file or directory: '/content/test.json'
@rish-hyun
Copy link
Author

I tried to manually run the code

url = "https://www.plyable.com"
json_file = "plyable.json"

extractor.extract(
    url = url, 
    destination = json_file
)

Output

/content/iww/extractor/resources_extractor.js https://www.plyable.com /content/plyable.json

But no such file is created!

@MohamedHmini
Copy link
Owner

Hi ,
Thanks for ur concern, i will start maintaining the repo soon, as for ur issue i will get back to u within the next 24 hours.

@rish-hyun
Copy link
Author

@MohamedHmini Any updates? Also, is it possible to achieve this same functionality using selenium?

Repository owner deleted a comment from devsquadcore Mar 14, 2024
Repository owner deleted a comment from devsquadcore Mar 14, 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

2 participants