Skip to content

Unable to get dynamic elements after scrolling #664

Answered by ziflex
rsinghtc asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, good news! WHILE loop has landed master branch! You may try this query:

LET doc = DOCUMENT("https://www.vrbo.com/search/keywords:atlanta-georgia-united-states-of-america?adultsCount=1&petIncluded=false", { driver: "cdp" })

LET canDoNext = 'a[data-wdio="pager-next"]:not(:disabled)'
LET nextBtnSelector = '.Pager__li--next'
LET loaderSelector = '.HitCollection--placeholder'

WAIT_NO_ELEMENT(doc, loaderSelector)

FOR p DO WHILE ELEMENT_EXISTS(doc, canDoNext)
	LET wait = p > 0 ? CLICK(doc, nextBtnSelector) && WAIT_NO_ELEMENT(doc, loaderSelector): false
	LET pageSize = ELEMENTS_COUNT(doc, '[data-wdio="HitCollection"] > div')
	
	FOR i IN 1..pageSize
		LET selector = FMT('[data-wdio="Waypoi…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ziflex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type/question Further information is requested status/stale Stale issue status/review-needed
2 participants
Converted from issue

This discussion was converted from issue #556 on September 20, 2021 00:24.