@democracy-deutschland/dip21-scraper
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -12,2 +12,3 @@ 'use strict'; | ||
const request = require('request'); | ||
const UserAgent = require('user-agents'); | ||
@@ -38,4 +39,8 @@ class DipBrowser { | ||
const headers = { | ||
'User-Agent': new UserAgent() | ||
}; | ||
return new Promise((resolve, reject) => { | ||
request(reqOptions, (error, res, body) => { | ||
request(_extends({}, reqOptions, { headers }), (error, res, body) => { | ||
if (!error && res.statusCode === 200) { | ||
@@ -42,0 +47,0 @@ resolve({ res, body }); |
@@ -336,3 +336,3 @@ 'use strict'; | ||
id: vorgangId.split('-')[1], | ||
url: `/dip21.web/searchProcedures/simple_search_list.do?selId=${vorgangId.split('-')[1]}&method=select&offset=0&anzahl=${_this.options.resultsPerPage}&sort=3&direction=desc`, | ||
url: `/dip21.web/searchProcedures/simple_search_list.do?selId=${vorgangId.split('-')[1]}&method=select&offset=0&anzahl=200&sort=3&direction=desc`, | ||
scraped: false | ||
@@ -356,2 +356,3 @@ }); | ||
newFormData.method = '>'; // Next page can only be reached through this | ||
newFormData.offset = (i - 1) * _this.options.resultsPerPage; | ||
const { body: tmpBody } = yield browser.browser.getSearchResultPage({ | ||
@@ -358,0 +359,0 @@ formMethod: newFormMethod, |
{ | ||
"name": "@democracy-deutschland/dip21-scraper", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "scraper for the german \"Bundestag\"", | ||
@@ -33,2 +33,3 @@ "main": "distribution/scraper.js", | ||
"request-cookies": "^1.1.0", | ||
"user-agents": "^1.0.539", | ||
"x2js": "^3.1.1" | ||
@@ -35,0 +36,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
982
54601
15
9
+ Addeduser-agents@^1.0.539
+ Addedlodash.clonedeep@4.5.0(transitive)
+ Addedpsl@1.14.0(transitive)
+ Addeduser-agents@1.1.375(transitive)
- Removedpsl@1.13.0(transitive)