Fix banner scraping
parent
b9de6e1838
commit
0855e88550
|
@ -108,11 +108,11 @@ export default class PlatformUser {
|
||||||
if (htmlResponse.isSuccess()) {
|
if (htmlResponse.isSuccess()) {
|
||||||
// Prepare cheerio
|
// Prepare cheerio
|
||||||
const $ = cheerio.load(htmlResponse.value);
|
const $ = cheerio.load(htmlResponse.value);
|
||||||
|
|
||||||
// Parse the elements
|
// Parse the elements
|
||||||
this._name = $(MEMBER.NAME).text();
|
this._name = $(MEMBER.NAME).text();
|
||||||
this._title = $(MEMBER.TITLE).text();
|
this._title = $(MEMBER.TITLE).text();
|
||||||
this._banners = $(MEMBER.BANNERS).toArray().map((idx, el) => $(el).text().trim()).filter(el => !el);
|
this._banners = $(MEMBER.BANNERS).toArray().map((el, idx) => $(el).text().trim()).filter(el => el);
|
||||||
this._avatar = $(MEMBER.AVATAR).attr("src");
|
this._avatar = $(MEMBER.AVATAR).attr("src");
|
||||||
this._followed = $(MEMBER.FOLLOWED).text() === "Unfollow";
|
this._followed = $(MEMBER.FOLLOWED).text() === "Unfollow";
|
||||||
this._ignored = $(MEMBER.IGNORED).text() === "Unignore";
|
this._ignored = $(MEMBER.IGNORED).text() === "Unignore";
|
||||||
|
@ -136,4 +136,5 @@ export default class PlatformUser {
|
||||||
}
|
}
|
||||||
|
|
||||||
//#endregion Public method
|
//#endregion Public method
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue