Skip to content

Commit 044bdfe

Browse files
committed
Update: Docs
1 parent 82d1b4f commit 044bdfe

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,18 @@ const myXCrawl = xCrawl({
9999
})
100100

101101
// 3.Set the crawling task
102-
/*
103-
Call the startPolling API to start the polling function,
102+
/*
103+
Call the startPolling API to start the polling function,
104104
and the callback function will be called every other day
105105
*/
106106
myXCrawl.startPolling({ d: 1 }, async (count, stopPolling) => {
107107
// Call crawlPage API to crawl Page
108108
const { page } = await myXCrawl.crawlPage('https://zh.airbnb.com/s/*/plus_homes')
109109

110110
// set request configuration
111-
const requestConfig = await page.$$eval('picture img', (img) => {
112-
return img.map((item) => item.src)
111+
const plusBoxHandle = await page.$('.a1stauiv')
112+
const requestConfig = await plusBoxHandle!.$$eval('picture img', (imgEls) => {
113+
return imgEls.map((item) => item.src)
113114
})
114115

115116
// Call the crawlFile API to crawl pictures

assets/en/crawler-result.png

-92.4 KB
Loading

assets/en/crawler.png

-26.3 KB
Loading

publish/README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,18 @@ const myXCrawl = xCrawl({
9999
})
100100

101101
// 3.Set the crawling task
102-
/*
103-
Call the startPolling API to start the polling function,
102+
/*
103+
Call the startPolling API to start the polling function,
104104
and the callback function will be called every other day
105105
*/
106106
myXCrawl.startPolling({ d: 1 }, async (count, stopPolling) => {
107107
// Call crawlPage API to crawl Page
108108
const { page } = await myXCrawl.crawlPage('https://zh.airbnb.com/s/*/plus_homes')
109109

110110
// set request configuration
111-
const requestConfig = await page.$$eval('picture img', (img) => {
112-
return img.map((item) => item.src)
111+
const plusBoxHandle = await page.$('.a1stauiv')
112+
const requestConfig = await plusBoxHandle!.$$eval('picture img', (imgEls) => {
113+
return imgEls.map((item) => item.src)
113114
})
114115

115116
// Call the crawlFile API to crawl pictures

test/start/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)