WIP: testing #40

Draft
yuessir wants to merge 6 commits from yuessir/matrix-puppeteer-line:testing into testing
Showing only changes of commit 7a10061384 - Show all commits

View File

@ -729,10 +729,13 @@ export default class MessagesPuppeteer {
return `#joined_group_list_body > li[data-chatid="${id}"]` return `#joined_group_list_body > li[data-chatid="${id}"]`
} }
_contactCountSelector() {
return `#contact_wrap_friends .MdLFT04Head._contactlist_header span[id=contact_friend_count]`
}
async _getWholeContactResults(page, distance) { async _getWholeContactResults(page, distance) {
await page.bringToFront() await page.bringToFront()
await page.waitForSelector("#contact_wrap_friends > ul.MdCMN03List") await page.waitForSelector("#contact_wrap_friends > ul.MdCMN03List")
const results = []
const contactTotalCount = 0 const contactTotalCount = 0
this.log(` distance is ${distance}`) this.log(` distance is ${distance}`)
let incred = 0 let incred = 0
@ -742,6 +745,7 @@ export default class MessagesPuppeteer {
return Number.parseInt(element?.innerText) || 0 return Number.parseInt(element?.innerText) || 0
}) })
this.log(` contact_friend_count is ${foundContactCount}`) this.log(` contact_friend_count is ${foundContactCount}`)
//infiniting contact list scrolling
while (incred <= distance) { while (incred <= distance) {
if (foundContactCount <= contactTotalCount) { if (foundContactCount <= contactTotalCount) {
return return
@ -822,7 +826,7 @@ export default class MessagesPuppeteer {
const leg = parseInt(ulstyleheight, 10) const leg = parseInt(ulstyleheight, 10)
this.log(`found contact_wrap_friends height is ${leg}px`) this.log(`found contact_wrap_friends height is ${leg}px`)
this.log(`starting to scroll to buttom`) this.log(`starting to scroll to buttom`)
const results = await this._getWholeContactResults(this.page, leg) await this._getWholeContactResults(this.page, leg)
this.log(`finished to scroll to buttom`) this.log(`finished to scroll to buttom`)
} }