-
How do I import URLS from an external file? I have seen |
Beta Was this translation helpful? Give feedback.
Answered by
philippta
Feb 17, 2024
Replies: 2 comments 2 replies
-
We have an example showing you can do to that: script:https://github.com/philippta/flyscrape/blob/master/examples/urls_from_file.js import urls from "./urls.txt"
export const config = {
urls: urls.split("\n")
};
export default function({ doc }) {
return {
title: doc.find("title").text().trim(),
};
} file with urls:https://github.com/philippta/flyscrape/blob/master/examples/urls.txt
|
Beta Was this translation helpful? Give feedback.
0 replies
-
In my case, it grabs only one URL from ./url.txt. url.txt has 1000 URLs. Not sure why, I copy & paste exactly as the examples. Any ideas? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update
With the v07.2 release, this got a lot more user friendly.
Flyscrape now automatically cleans up the urls and also ignores empty lines in the file.
This also means, the JavaScript can be simplified a lot.