Skip to content

Commit 5d5ac66

Browse files
committed
we, not you
1 parent 1bd628d commit 5d5ac66

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

sources/academy/platform/scraping_with_apify_and_ai/01_creating_actor.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ unlisted: true
99

1010
---
1111

12-
Want to get data about prices on [this Sales page](https://warehouse-theme-metal.myshopify.com/collections/sales)? Even without knowing how to code, you can open [ChatGPT](https://chatgpt.com/), type the following, and you'll have a scraper ready:
12+
Want to get data about prices on [this Sales page](https://warehouse-theme-metal.myshopify.com/collections/sales)? Even without knowing how to code, we can open [ChatGPT](https://chatgpt.com/), type the following, and we'll have a scraper ready:
1313

1414
```text
1515
Create a scraper in JavaScript which downloads
@@ -50,11 +50,11 @@ With AI, we don't need to learn coding before we build a scraper. AI writes the
5050

5151
We'll develop our scraper in a mainstream programming language called JavaScript. To run command line programs written in JavaScript, we'll need a tool called Node.js.
5252

53-
Let's head to the [Download Node.js](https://nodejs.org/en/download) web page. You should see a row of configuration dropdowns and a rather large code block below, with quite a few commands. Check if the website guessed your operating system correctly, and copy the whole block to the clipboard:
53+
Let's head to the [Download Node.js](https://nodejs.org/en/download) web page. We should see a row of configuration dropdowns and a rather large code block below, with quite a few commands. Let's check if the website guessed our operating system correctly, then copy the whole block to the clipboard:
5454

5555
![Download Node.js](images/nodejs-install.webp)
5656

57-
Now paste it as-is to your Terminal (macOS/Linux) or Command Prompt (Windows) and let it execute using the <kbd>↵</kbd> key. Once the installation finishes, you should see versions of Node.js and npm (another related tool) printed:
57+
Now let's paste it as-is to our Terminal (macOS/Linux) or Command Prompt (Windows) and let it execute using the <kbd>↵</kbd> key. Once the installation finishes, we should see versions of Node.js and npm (another related tool) printed:
5858

5959
```text
6060
...
@@ -64,7 +64,7 @@ $ npm -v
6464
11.6.2
6565
```
6666

67-
The exact version numbers are not really important. If you see the versions printed, it means we've successfully installed Node.js and npm.
67+
The exact version numbers are not really important. If we see the versions printed, it means we've successfully installed Node.js and npm.
6868

6969
## Installing Apify CLI
7070

@@ -96,7 +96,7 @@ Now let's use the Apify CLI to help us kick off a new Actor:
9696
apify create warehouse-scraper
9797
```
9898

99-
It starts a wizard where you can choose from various options. For each option, press <kbd>↵</kbd> to accept the default:
99+
It starts a wizard where we can choose from various options. For each option, let's press <kbd>↵</kbd> to accept the default:
100100

101101
```text
102102
✔ Choose the programming language of your new Actor: JavaScript
@@ -133,7 +133,7 @@ Out of the box, the template includes a sample Actor that walks through the [cra
133133
apify run
134134
```
135135

136-
If you see a flood of output mentioning something called `CheerioCrawler`, it means the template works and we can move on to editing its files so that it does what we want.
136+
If we see a flood of output mentioning something called `CheerioCrawler`, it means the template works and we can move on to editing its files so that it does what we want.
137137

138138
```text
139139
...
@@ -146,7 +146,9 @@ INFO CheerioCrawler: Finished! Total 107 requests: 107 succeeded, 0 failed. {"t
146146

147147
We're done with commands for now, but do not close the Terminal or Command Prompt window yet, as we'll soon need it again.
148148

149-
If you run into issues with the template wizard or the sample Actor, share this tutorial with [ChatGPT](https://chatgpt.com/), include the errors you saw, and ask for help debugging.
149+
:::caution Debugging
150+
If we run into issues with the template wizard or the sample Actor, let's share this tutorial with [ChatGPT](https://chatgpt.com/), include the errors we saw, and ask for help debugging.
151+
:::
150152

151153
## Scraping products
152154

@@ -155,7 +157,7 @@ Now we're ready to get our own scraper done. We'll open the `src` directory insi
155157
We'll open it in a _plain text editor_. Every operating system includes one: Notepad on Windows, TextEdit on macOS, and similar tools on Linux.
156158

157159
:::danger Avoid rich text editors
158-
Do not use a _rich text editor_, such as Microsoft Word. They're great for human-readable documents with rich formatting, but for code editing, use either dedicated coding editors, or the simplest tool possible.
160+
Let's not use a _rich text editor_, such as Microsoft Word. They're great for human-readable documents with rich formatting, but for code editing, we'll use either dedicated coding editors, or the simplest tool possible.
159161
:::
160162

161163
In the editor, we can see JavaScript code. Let's select all the code and copy to our clipboard. Then we'll open a _new ChatGPT conversation_ and start with a prompt like this:
@@ -188,7 +190,7 @@ When we're done, we must not forget to _save the change_ with <kbd>Ctrl+S</kbd>
188190
apify run
189191
```
190192

191-
If we are lucky, the output should be similar to this:
193+
If all goes well, the output should be similar to this:
192194

193195
```text
194196
Run: npm run start
@@ -207,15 +209,15 @@ INFO Total products collected: 24
207209

208210
This output says `Total products collected: 24`. The Sales page displays 24 products per page and contains 50 products in total.
209211

210-
Depending on whether ChatGPT decided to walk through all pages or scrape just the first one, you might get 24 or more products. For now, any sign that it scraped products is good news.
212+
Depending on whether ChatGPT decided to walk through all pages or scrape just the first one, we might get 24 or more products. For now, any sign that it scraped products is good news.
211213

212214
:::caution Debugging
213-
If your program crashes instead, copy the error message, send it to your ChatGPT conversation, and ask for a fix.
215+
If our program crashes instead, let's copy the error message, send it to our ChatGPT conversation, and ask for a fix.
214216
:::
215217

216218
## Exporting to CSV
217219

218-
Our program likely works, but we haven't seen the data yet. Let's add a CSV export. CSV is a format most data apps can read, including Microsoft Excel, Google Sheets, and Apple Numbers. Continue your ChatGPT conversation with:
220+
Our program likely works, but we haven't seen the data yet. Let's add a CSV export. CSV is a format most data apps can read, including Microsoft Excel, Google Sheets, and Apple Numbers. Let's continue our ChatGPT conversation with:
219221

220222
```text
221223
Before the program ends, I want it to export all data

0 commit comments

Comments
 (0)