Skip to content

Commit

Permalink
fix: remove url duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
popstas committed Mar 6, 2020
1 parent 0577b39 commit 110b379
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ npm start
Все настройки делаются в `src/scrap-site.js`, комментарии там же.

## Баги
- Иногда пишет в csv одинаковые страницы
Иногда пишет в csv одинаковые страницы. Это бывает в 2 случаях:
1. Редирект с другой страницы на эту (решается установкой `skipRequestedRedirect: true`, сделано).
2. Одновременный запрос одной и той же страницы в параллельных потоках.

## TODO:
- Не учитывать страницы ?page= , но сканировать
1 change: 1 addition & 0 deletions src/scrap-site.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ module.exports = async (baseUrl, options = {}) => {
allowedDomains: [domain], // закомментить, если надо не только этот домен (лучше дописать)
maxDepth: 10, // макс. глубина
maxConcurrency: 2, // параллельные потоки
skipRequestedRedirect: true, // все редиректы помечаются как посещённые
// maxRequest: 10, // для тестов
depthPriority: false, // без этой опции сканирует криво, многое не видит
// followSitemapXml: true, // чтобы найти больше страниц
Expand Down

0 comments on commit 110b379

Please sign in to comment.