Skip to content

Commit 89a52f6

Browse files
committed
docs: example gif
1 parent 5a8f6b1 commit 89a52f6

File tree

3 files changed

+22
-14
lines changed

3 files changed

+22
-14
lines changed

docs/cn/guide/index.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ crawlApp.crawlPage('https://www.airbnb.cn/s/select_homes').then(async (res) => {
6464
await page.waitForSelector(targetSelector)
6565
const highlyHTML = await page.$eval(targetSelector, (el) => el.innerHTML)
6666

67-
// 让 AI 获取 img 的 url , 并去重
67+
// 让 AI 获取图片链接, 并去重 (描述越详细越好)
6868
const srcResult = await crawlOpenAIApp.parseElements(
6969
highlyHTML,
70-
'获取img的url, 并去重'
70+
'获取图片链接, 不要source里面的, 并去重'
7171
)
7272

7373
browser.close()
@@ -81,9 +81,13 @@ crawlApp.crawlPage('https://www.airbnb.cn/s/select_homes').then(async (res) => {
8181
```
8282

8383
::: tip
84-
你甚至可以将整个 HTML 传给 AI 帮我们操作,由于网站内容更加复杂你还需要更准确描述要取的位置,最重要的是会消耗更多 Tokens 。
84+
你甚至可以将整个 HTML 传给 AI 帮我们操作,由于网站内容更加复杂你还需要更准确描述要取的位置,并且会消耗大量的 Tokens 。
8585
:::
8686

87+
过程:
88+
89+
![](/example.gif)
90+
8791
爬到的高评分度假屋图片:
8892

8993
![](/example.png)
@@ -1319,13 +1323,13 @@ crawlApp.crawlPage('https://www.airbnb.cn/s/select_homes').then(async (res) => {
13191323
"src": "https://z1.muscache.cn/im/pictures/miso/Hosting-45937791/original/c67d32ed-21eb-4066-8cef-650dcd45bada.jpeg?im_w=720"
13201324
},
13211325
{
1322-
"src": "https://z1.muscache.cn/im/pictures/52d375d3-5e54-444b-8186-15e61a592d9a.jpg?im_w=720"
1326+
"src": "https://z1.muscache.cn/im/pictures/df3493cf-39b2-46cc-9e85-7ef186980f25.jpg?im_w=720"
13231327
},
13241328
{
1325-
"src": "https://z1.muscache.cn/im/pictures/4ce87a7c-cbce-4e6e-97ea-38840518e1c4.jpg?im_w=720"
1329+
"src": "https://z1.muscache.cn/im/pictures/52d375d3-5e54-444b-8186-15e61a592d9a.jpg?im_w=720"
13261330
},
13271331
{
1328-
"src": "https://z1.muscache.cn/im/pictures/3f6b8ce1-df9b-4624-94e0-b63ec54b7fe4.jpg?im_w=720"
1332+
"src": "https://z1.muscache.cn/im/pictures/4ce87a7c-cbce-4e6e-97ea-38840518e1c4.jpg?im_w=720"
13291333
},
13301334
{
13311335
"src": "https://z1.muscache.cn/im/pictures/miso/Hosting-661881998531696630/original/c7f7769f-e56c-4d55-8e74-06fdaf3e048d.jpeg?im_w=720"
@@ -1349,7 +1353,7 @@ crawlApp.crawlPage('https://www.airbnb.cn/s/select_homes').then(async (res) => {
13491353
"src": "https://z1.muscache.cn/im/pictures/miso/Hosting-792178978933830608/original/75a7613c-e435-45fb-9db4-e4163921254b.jpeg?im_w=720"
13501354
},
13511355
{
1352-
"src": "https://z1.muscache.cn/im/pictures/5e755fa0-74a5-400c-b33d-427e56f84330.jpg?im_w=720"
1356+
"src": "https://z1.muscache.cn/im/pictures/bafaacfa-1644-4a3b-9165-bcd831924cc6.jpg?im_w=720"
13531357
}
13541358
],
13551359
"type": "multiple"

docs/guide/index.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ crawlApp.crawlPage('https://www.airbnb.cn/s/select_homes').then(async (res) => {
6464
await page.waitForSelector(targetSelector)
6565
const highlyHTML = await page.$eval(targetSelector, (el) => el.innerHTML)
6666

67-
// Let AI obtain the url of img and remove duplicates
67+
// Let the AI get the image link and de-duplicate it (the more detailed the description, the better)
6868
const srcResult = await crawlOpenAIApp.parseElements(
6969
highlyHTML,
70-
'Get the url of img and remove duplicates'
70+
`Get the image link, don't source it inside, and de-duplicate it`
7171
)
7272

7373
browser.close()
@@ -81,9 +81,13 @@ crawlApp.crawlPage('https://www.airbnb.cn/s/select_homes').then(async (res) => {
8181
```
8282

8383
::: tip
84-
You can even pass the entire HTML to AI to help us operate it. Since the website content is more complex, you also need to describe the location to be taken more accurately. The most important thing is that it will consume more Tokens.
84+
You can even send the whole HTML to the AI to help us operate, because the website content is more complex you also need to describe the location to get more accurately, and will consume a lot of Tokens.
8585
:::
8686

87+
Procedure:
88+
89+
![](/example.gif)
90+
8791
Pictures of highly rated vacation rentals climbed to:
8892

8993
![](/example.png)
@@ -1319,13 +1323,13 @@ For ease of viewing, it is formatted here
13191323
"src": "https://z1.muscache.cn/im/pictures/miso/Hosting-45937791/original/c67d32ed-21eb-4066-8cef-650dcd45bada.jpeg?im_w=720"
13201324
},
13211325
{
1322-
"src": "https://z1.muscache.cn/im/pictures/52d375d3-5e54-444b-8186-15e61a592d9a.jpg?im_w=720"
1326+
"src": "https://z1.muscache.cn/im/pictures/df3493cf-39b2-46cc-9e85-7ef186980f25.jpg?im_w=720"
13231327
},
13241328
{
1325-
"src": "https://z1.muscache.cn/im/pictures/4ce87a7c-cbce-4e6e-97ea-38840518e1c4.jpg?im_w=720"
1329+
"src": "https://z1.muscache.cn/im/pictures/52d375d3-5e54-444b-8186-15e61a592d9a.jpg?im_w=720"
13261330
},
13271331
{
1328-
"src": "https://z1.muscache.cn/im/pictures/3f6b8ce1-df9b-4624-94e0-b63ec54b7fe4.jpg?im_w=720"
1332+
"src": "https://z1.muscache.cn/im/pictures/4ce87a7c-cbce-4e6e-97ea-38840518e1c4.jpg?im_w=720"
13291333
},
13301334
{
13311335
"src": "https://z1.muscache.cn/im/pictures/miso/Hosting-661881998531696630/original/c7f7769f-e56c-4d55-8e74-06fdaf3e048d.jpeg?im_w=720"
@@ -1349,7 +1353,7 @@ For ease of viewing, it is formatted here
13491353
"src": "https://z1.muscache.cn/im/pictures/miso/Hosting-792178978933830608/original/75a7613c-e435-45fb-9db4-e4163921254b.jpeg?im_w=720"
13501354
},
13511355
{
1352-
"src": "https://z1.muscache.cn/im/pictures/5e755fa0-74a5-400c-b33d-427e56f84330.jpg?im_w=720"
1356+
"src": "https://z1.muscache.cn/im/pictures/bafaacfa-1644-4a3b-9165-bcd831924cc6.jpg?im_w=720"
13531357
}
13541358
],
13551359
"type": "multiple"

docs/public/example.gif

6.82 MB
Loading

0 commit comments

Comments
 (0)