Popup links and videourls

Hi,

I struggle with a popup link. I am trying to extract a video url and other market data but as soon as the popup link starts I do not get anything out of the newly opened window and it does not close afterwards. Even if I get around that issue (leaving it open), I struggle to get the URL of the video or anything else out. I do this project, because I want to understand what drives the price of teachers and if there are differences between languages.

Url: https://preply.com/

Sitemap:
{"_id":"fin","startUrl":["https://preply.com/"],"selectors":[{"id":"pages","parentSelectors":["language"],"type":"SelectorElementClick","clickElementSelector":".pagerItem___Rw2Cw a","clickElementUniquenessType":"uniqueText","clickType":"clickOnce","delay":2000,"discardInitialElements":"do-not-discard","multiple":true,"selector":"main"},{"id":"scroll","parentSelectors":["pages"],"type":"SelectorElementScroll","selector":"parent","multiple":false,"delay":2000},{"id":"card","parentSelectors":["scroll"],"type":"SelectorElement","selector":"section.SearchCard___1iYyy","multiple":true,"delay":0},{"id":"name","parentSelectors":["card"],"type":"SelectorText","selector":"h4","multiple":false,"delay":0,"regex":""},{"id":"price","parentSelectors":["card"],"type":"SelectorText","selector":"div.PriceIndicatorPrice___w9jW1","multiple":false,"delay":0,"regex":""},{"id":"speaks","parentSelectors":["card"],"type":"SelectorText","selector":"ul.Speaks___27SQY","multiple":false,"delay":0,"regex":""},{"id":"exp","parentSelectors":["card"],"type":"SelectorText","selector":"span.TotalLessons___nLIm9","multiple":false,"delay":0,"regex":""},{"id":"actstud","parentSelectors":["card"],"type":"SelectorText","selector":"span.ActiveStudents___I9k62","multiple":false,"delay":0,"regex":""},{"id":"desc","parentSelectors":["card"],"type":"SelectorText","selector":"span.Headline___7WVvy","multiple":false,"delay":0,"regex":""},{"id":"rev","parentSelectors":["card"],"type":"SelectorText","selector":"div.RatingIndicatorRating___374zP","multiple":false,"delay":0,"regex":""},{"id":"nr_rev","parentSelectors":["card"],"type":"SelectorText","selector":"button.RatingIndicatorText___2oEyE","multiple":false,"delay":0,"regex":""},{"id":"img","parentSelectors":["card"],"type":"SelectorImage","selector":"img.AvatarImg___2dRk2","multiple":false,"delay":0},{"id":"language","parentSelectors":["_root"],"type":"SelectorLink","selector":"a.title___2PfVY","multiple":true,"delay":0},{"id":"link","parentSelectors":["card"],"type":"SelectorPopupLink","selector":"a.FullName___3aqlf","multiple":true,"delay":0},{"id":"vid","parentSelectors":["link"],"type":"SelectorElementClick","clickElementSelector":".SidePanel___2kcLy div.VideoPreview___kmhkJ","clickElementUniquenessType":"uniqueText","clickType":"clickOnce","delay":2000,"discardInitialElements":"do-not-discard","multiple":false,"selector":".SidePanel___2kcLy div.VideoPreview___kmhkJ"}]}

@Cordelio Hi. It looks like you can use a 'link' selector instead. Also, the scroll selector should be set as '' _parent_'' not parent.

Dear viesturs, thanks a lot! Solved the link problem perfectly!

I have one more little struggle. If I want to get the URL of a video, I have to click twice at it, once to sort of get it working and the second to play it.
So I tried to take the click selector to click at it and also selecting the complete page. In the next step, I tried to get the URL. But I cannot select it. Do you have any suggestions?

Thanks a lot!

Hi @Cordelio

You will have to make an additional "Element click" selector - div[class*="SidePanelWrap"] div[data-qa-id="open-video-btn"] set as a 'parent' to the 'Element attribute' selector - div[class*="player"] iframe with an 'Attribute name' - src.

Example:

{"_id":"preply-com-example","startUrl":["https://preply.com/en/tutor/1868144/"],"selectors":[{"clickElementSelector":"div[class*=\"SidePanelWrap\"] div[data-qa-id=\"open-video-btn\"]","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":"1250","discardInitialElements":"discard-when-click-element-exists","id":"video-click","multiple":true,"parentSelectors":["_root"],"selector":"html","type":"SelectorElementClick"},{"delay":0,"extractAttribute":"src","id":"video-link","multiple":false,"parentSelectors":["video-click"],"selector":"div[class*=\"player\"] iframe","type":"SelectorElementAttribute"}]}

Hope it solves this issue!