Skip to content

Commit

Permalink
Fix CEI URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Menighin committed Nov 8, 2020
1 parent c227ac2 commit 4d3004f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cei-crawler",
"version": "2.0.3",
"version": "2.1.0",
"description": "Crawler para pegar dados do Canal Eletronico do Investidor",
"main": "src/app.js",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/CeiCrawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CeiCrawler {
this._cookieManager = new FetchCookieManager({
'Host': 'cei.b3.com.br',
'Origin': 'https://cei.b3.com.br',
'Referer': 'https://cei.b3.com.br/CEI_Responsivo/login.aspx',
'Referer': 'https://ceiapp.b3.com.br/CEI_Responsivo/login.aspx',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36'
}, this.options.navigationTimeout);
}
Expand All @@ -63,7 +63,7 @@ class CeiCrawler {
if ((this.options && this.options.trace) || false)
console.log('Logging at CEI...');

const getPageLogin = await this._cookieManager.fetch("https://cei.b3.com.br/CEI_Responsivo/login.aspx");
const getPageLogin = await this._cookieManager.fetch("https://ceiapp.b3.com.br/CEI_Responsivo/login.aspx");
const doomLoginPage = cheerio.load(await getPageLogin.text());

doomLoginPage('#ctl00_ContentPlaceHolder1_txtLogin').attr('value', this.username);
Expand All @@ -87,7 +87,7 @@ class CeiCrawler {
});

await CeiUtils.retry(async () => {
const postLogin = await this._cookieManager.fetch("https://cei.b3.com.br/CEI_Responsivo/login.aspx", {
const postLogin = await this._cookieManager.fetch("https://ceiapp.b3.com.br/CEI_Responsivo/login.aspx", {
"headers": {
"accept": "*/*",
"accept-language": "pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7",
Expand All @@ -100,7 +100,7 @@ class CeiCrawler {
"x-requested-with": "XMLHttpRequest",
'Connection': 'keep-alive'
},
"referrer": "https://cei.b3.com.br/CEI_Responsivo/login.aspx",
"referrer": "https://ceiapp.b3.com.br/CEI_Responsivo/login.aspx",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": formData,
"method": "POST",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/DividendsCrawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const cheerio = require('cheerio');
const normalizeWhitespace = require('normalize-html-whitespace');

const PAGE = {
URL: 'https://cei.b3.com.br/CEI_Responsivo/ConsultarProventos.aspx',
URL: 'https://ceiapp.b3.com.br/CEI_Responsivo/ConsultarProventos.aspx',
SUBMIT_BUTTON: '#ctl00_ContentPlaceHolder1_btnConsultar',
TABLE_CLASS: '.responsive tbody',
TABLE_CLASS_ROWS: '.responsive tbody tr',
Expand Down Expand Up @@ -49,7 +49,7 @@ const FETCH_OPTIONS = {
"x-microsoftajax": "Delta=true",
"x-requested-with": "XMLHttpRequest"
},
"referrer": "https://cei.b3.com.br/CEI_Responsivo/ConsultarProventos.aspx",
"referrer": "https://ceiapp.b3.com.br/CEI_Responsivo/ConsultarProventos.aspx",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "POST",
Expand All @@ -68,7 +68,7 @@ const FETCH_OPTIONS = {
"x-microsoftajax": "Delta=true",
"x-requested-with": "XMLHttpRequest"
},
"referrer": "https://cei.b3.com.br/CEI_Responsivo/ConsultarProventos.aspx",
"referrer": "https://ceiapp.b3.com.br/CEI_Responsivo/ConsultarProventos.aspx",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "POST",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/StockHistoryCrawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const cheerio = require('cheerio');
const normalizeWhitespace = require('normalize-html-whitespace');

const PAGE = {
URL: 'https://cei.b3.com.br/CEI_Responsivo/negociacao-de-ativos.aspx',
URL: 'https://ceiapp.b3.com.br/CEI_Responsivo/negociacao-de-ativos.aspx',
SELECT_INSTITUTION: '#ctl00_ContentPlaceHolder1_ddlAgentes',
SELECT_INSTITUTION_OPTIONS: '#ctl00_ContentPlaceHolder1_ddlAgentes option',
SELECT_ACCOUNT: '#ctl00_ContentPlaceHolder1_ddlContas',
Expand Down Expand Up @@ -60,7 +60,7 @@ const FETCH_OPTIONS = {
"x-requested-with": "XMLHttpRequest",
"Connection": "keep-alive"
},
"referrer": "https://cei.b3.com.br/CEI_Responsivo/negociacao-de-ativos.aspx",
"referrer": "https://ceiapp.b3.com.br/CEI_Responsivo/negociacao-de-ativos.aspx",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "POST",
Expand All @@ -79,7 +79,7 @@ const FETCH_OPTIONS = {
"x-microsoftajax": "Delta=true",
"x-requested-with": "XMLHttpRequest"
},
"referrer": "https://cei.b3.com.br/CEI_Responsivo/negociacao-de-ativos.aspx",
"referrer": "https://ceiapp.b3.com.br/CEI_Responsivo/negociacao-de-ativos.aspx",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "POST",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/WalletCrawler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const cheerio = require('cheerio');
const normalizeWhitespace = require('normalize-html-whitespace');

const PAGE = {
URL: 'https://cei.b3.com.br/CEI_Responsivo/ConsultarCarteiraAtivos.aspx',
URL: 'https://ceiapp.b3.com.br/CEI_Responsivo/ConsultarCarteiraAtivos.aspx',
SELECT_INSTITUTION: '#ctl00_ContentPlaceHolder1_ddlAgentes',
SELECT_INSTITUTION_OPTIONS: '#ctl00_ContentPlaceHolder1_ddlAgentes option',
SELECT_ACCOUNT: '#ctl00_ContentPlaceHolder1_ddlContas',
Expand Down Expand Up @@ -62,7 +62,7 @@ const FETCH_OPTIONS = {
"x-microsoftajax": "Delta=true",
"x-requested-with": "XMLHttpRequest"
},
"referrer": "https://cei.b3.com.br/CEI_Responsivo/ConsultarCarteiraAtivos.aspx",
"referrer": "https://ceiapp.b3.com.br/CEI_Responsivo/ConsultarCarteiraAtivos.aspx",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "POST",
Expand All @@ -81,7 +81,7 @@ const FETCH_OPTIONS = {
"x-microsoftajax": "Delta=true",
"x-requested-with": "XMLHttpRequest"
},
"referrer": "https://cei.b3.com.br/CEI_Responsivo/ConsultarCarteiraAtivos.aspx",
"referrer": "https://ceiapp.b3.com.br/CEI_Responsivo/ConsultarCarteiraAtivos.aspx",
"referrerPolicy": "strict-origin-when-cross-origin",
"body": null,
"method": "POST",
Expand Down

0 comments on commit 4d3004f

Please sign in to comment.