diff options
| author | Philipp Tanlak <philipp.tanlak@gmail.com> | 2023-10-19 17:54:18 +0200 |
|---|---|---|
| committer | Philipp Tanlak <philipp.tanlak@gmail.com> | 2023-10-19 18:21:58 +0200 |
| commit | 0daefa86b400efe08245f4f2a386f7341b76b24e (patch) | |
| tree | 60d743bb9734a9d7f46701a5ac9026650a330d49 /docs/using-flyscrape/development-mode.md | |
| parent | 03b3be0c3bbc70584e8988e1810dc28eacf4521f (diff) | |
docs: Add documentationv0.3.0
Diffstat (limited to 'docs/using-flyscrape/development-mode.md')
| -rw-r--r-- | docs/using-flyscrape/development-mode.md | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/docs/using-flyscrape/development-mode.md b/docs/using-flyscrape/development-mode.md new file mode 100644 index 0000000..b2da076 --- /dev/null +++ b/docs/using-flyscrape/development-mode.md @@ -0,0 +1,53 @@ +# Development Mode + +Development Mode in flyscrape allows you to streamline the process of creating and fine-tuning your scraping scripts. With the `flyscrape dev` command, you can watch your scraping script for changes and see the results in real-time, making it easier to iterate and perfect your data extraction process during development. + +## The `flyscrape dev` Command + +The `flyscrape dev` command is a powerful tool that enhances your development workflow by automating the execution of your scraping script when changes are detected. This feature is incredibly useful for several reasons: + +1. **Immediate Feedback**: With Development Mode, you can make changes to your scraping script and instantly see the impact of those changes. There's no need to manually run the script after each modification. + +2. **Efficiency**: It eliminates the need to repeatedly run the `flyscrape run` command while you fine-tune your scraping logic. This boosts your efficiency and accelerates development. + +3. **Real-time Debugging**: If you encounter issues or unexpected behavior in your scraping script, you can quickly identify and fix problems with real-time feedback. + +## Using the `flyscrape dev` Command + +To activate Development Mode, use the `flyscrape dev` command followed by the name of your scraping script. For example: + +```bash +flyscrape dev my_scraping_script.js +``` + +This command will start watching your scraping script file (`my_scraping_script.js` in this case) for changes. Whenever you save changes to the script, flyscrape will automatically re-run it, allowing you to view the updated results in your terminal. + +## Tips for Development Mode + +Here are some tips to make the most of Development Mode: + +1. **Keep Your Editor Open**: Keep your code editor open and edit your scraping script as needed. When you save the changes, flyscrape will automatically pick them up. + +2. **Console Output**: Use `console.log()` statements within your scraping script to output debugging information to the console. This can be helpful for diagnosing issues. + +3. **Iterate and Experiment**: Take advantage of Development Mode to experiment with different data extraction queries and strategies. The rapid feedback loop makes it easy to iterate and find the right approach. + +## Example Workflow + +Here's an example of how a typical workflow might look in Development Mode: + +1. Create a new scraping script using `flyscrape new`. + +2. Use `flyscrape dev` to start watching the script. + +3. Edit the script, add data extraction logic, and save the changes. + +4. Observe the results in real-time in the terminal. + +5. If needed, make further changes and continue iterating until you achieve the desired data extraction results. + +Development Mode is an invaluable tool for scraping script development, enabling you to build and refine your scripts efficiently and effectively. + +--- + +This concludes the "Development Mode" section, which demonstrates how to use the `flyscrape dev` command to streamline your scraping script development process. Next, you can explore how to initiate scraping with the "Start scraping" section to gather data from websites. |