refactor: inline single-use haswatchordertable
This commit is contained in:
@@ -169,10 +169,6 @@ func extractRows(doc *goquery.Document) []watchOrderRow {
|
|||||||
return rows
|
return rows
|
||||||
}
|
}
|
||||||
|
|
||||||
func hasWatchOrderTable(doc *goquery.Document) bool {
|
|
||||||
return doc.Find("#wo_list").Length() > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// shouldTryProxy returns true for transient errors where the Jina proxy may help
|
// shouldTryProxy returns true for transient errors where the Jina proxy may help
|
||||||
// (e.g. Cloudflare blocking, rate limits)
|
// (e.g. Cloudflare blocking, rate limits)
|
||||||
func shouldTryProxy(err error) bool {
|
func shouldTryProxy(err error) bool {
|
||||||
@@ -358,7 +354,7 @@ func FetchWatchOrder(ctx context.Context, httpClient *http.Client, url string) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// empty table indicates JS-rendered content; need proxy
|
// empty table indicates JS-rendered content; need proxy
|
||||||
if !hasWatchOrderTable(doc) {
|
if doc.Find("#wo_list").Length() == 0 {
|
||||||
return fetchViaProxy(ctx, httpClient, url, rootID)
|
return fetchViaProxy(ctx, httpClient, url, rootID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user