Skip to content

Commit

Permalink
Make merge public
Browse files Browse the repository at this point in the history
  • Loading branch information
MengLinMaker committed Oct 18, 2023
1 parent f329184 commit 5d1a887
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webscrape/src/website/ProductInfoReport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class ProductInfoReport {

#addFailedSection(section: string) { this.#report.failedSection.push(section) }

#merge(anotherScrapeReport: ProductInfoReport) {
merge(anotherScrapeReport: ProductInfoReport) {
const report = anotherScrapeReport.get()

this.#report.productInfo = [...this.#report.productInfo, ...report.productInfo]
Expand All @@ -70,14 +70,14 @@ export class ProductInfoReport {

recordProductInfoPage(getPageProductInfo: any, rawPageData: string) {
const page = getPageProductInfo(rawPageData)
this.#merge(page)
this.merge(page)
}

async recordProductInfoSection(getSectionProductInfo: any, requestDatum: any, cookie?: string) {
try {
const report = await getSectionProductInfo(requestDatum, cookie)
if (report.get().productInfo.length == 0) throw(`Section failed: ${requestDatum}`)
this.#merge(report)
this.merge(report)
} catch {
this.#addFailedSection(requestDatum)
}
Expand Down

0 comments on commit 5d1a887

Please sign in to comment.