How to set up Element click?

Hi, can you please help me with getting data from a sport site?

I would like to download stats for one day for all games played. I think I have created the retrieval of all matches on the page correctly. However, to view the stats, I need to click on each individual match and then click on "STATISTICS" which will be displayed when I click on the match. And that's where I have a problem. I don't know how to access the data that is created after clicking on a match.

I have created a sitemap that has the data I would like to download. Can someone please help me set up the sitemap to get the data I would like?

Thank you in advance!

Url: SofaScore: The Fastest Football Scores and Live Score for 2021

Sitemap:
{"_id":"sofascore_fotbal","startUrl":["https://www.sofascore.com/football/2021-09-21"],"selectors":[{"clickElementSelector":"button.styles__ShowMoreButton-sc-17nbpjd-16","clickElementUniquenessType":"uniqueText","clickType":"clickOnce","delay":2000,"discardInitialElements":"do-not-discard","id":"all matches","multiple":false,"parentSelectors":["_root"],"selector":"div.styles__MainListWrapper-sc-17nbpjd-10","type":"SelectorElementClick"},{"clickElementSelector":"div.EventCellstyles__EventCell-sc-4ti8ha-0","clickElementUniquenessType":"uniqueText","clickType":"clickOnce","delay":2000,"discardInitialElements":"do-not-discard","id":"game_detail","multiple":true,"parentSelectors":["_root"],"selector":"div.styles__MainListWrapper-sc-17nbpjd-10","type":"SelectorElementClick"},{"delay":0,"id":"League","multiple":false,"parentSelectors":["game_detail"],"regex":"","selector":".BreadcrumbContent__Content-sc-hzuqsg-0 li:nth-of-type(2) a","type":"SelectorText"},{"delay":0,"id":"Date","multiple":false,"parentSelectors":["game_detail"],"regex":"","selector":".styles__StyledDetails-sc-1e616vt-2 > div.dUsJVl div:nth-of-type(1) div","type":"SelectorText"},{"delay":0,"id":"ball_possession (home)","multiple":false,"parentSelectors":["stats"],"regex":"","selector":"div.styles__StatisticsGroup-sc-1imujgi-3:nth-of-type(1) div.Section-sc-umtr2b-0:nth-of-type(1) div","type":"SelectorText"},{"delay":0,"id":"ball_possession (away)","multiple":false,"parentSelectors":["stats"],"regex":"","selector":"div.styles__StatisticsGroup-sc-1imujgi-3:nth-of-type(1) div.jJmiAs","type":"SelectorText"},{"delay":0,"id":"game","multiple":false,"parentSelectors":["game_detail"],"regex":"","selector":"a.styles__EventLink-sc-1e616vt-0","type":"SelectorText"},{"clickElementSelector":".styles__InnerWrapper-sc-bbbdjr-2 a:nth-of-type(3)","clickElementUniquenessType":"uniqueText","clickType":"clickOnce","delay":2000,"discardInitialElements":"do-not-discard","id":"stats","multiple":true,"parentSelectors":["game_detail"],"selector":".styles__InnerWrapper-sc-bbbdjr-2 div.Tabs__Header-sc-fivvzb-0","type":"SelectorElementClick"}]}

Hi @jhhrdlicka Due to how this website is made/structured the best way to scrape it would be by splitting the sitemap in two parts(one with the scroll down selector and one without) and zoom out the page as far as you can.

Sitemap example:

{"_id":"sofascore_fotbal","startUrl":["https://www.sofascore.com/football/2021-09-21"],"selectors":[{"delay":0,"id":"League","multiple":false,"parentSelectors":["match-wrapper"],"regex":"","selector":".BreadcrumbContent__Content-sc-hzuqsg-0 li:nth-of-type(2) a","type":"SelectorText"},{"delay":0,"id":"Date","multiple":false,"parentSelectors":["match-wrapper"],"regex":"","selector":"div[class*=\"styles__StyledDetails\"] > div:contains(\"2021\"):nth(0)","type":"SelectorText"},{"delay":0,"id":"ball_possession (home)","multiple":false,"parentSelectors":["match-wrapper"],"regex":"","selector":"div[class*=\"styles__StatisticsGroup\"] div[class*=\"Cell\"]:contains(\"Ball possession\") div[class*=\"Content\"]:contains(\"%\"):nth(0)","type":"SelectorText"},{"delay":0,"id":"ball_possession (away)","multiple":false,"parentSelectors":["match-wrapper"],"regex":"","selector":"div[class*=\"styles__StatisticsGroup\"] div[class*=\"Cell\"]:contains(\"Ball possession\") div[class*=\"Content\"]:contains(\"%\"):nth(1)","type":"SelectorText"},{"delay":0,"id":"game","multiple":false,"parentSelectors":["match-wrapper"],"regex":"","selector":"a[data-id]","type":"SelectorText"},{"delay":0,"id":"match-wrapper","multiple":true,"parentSelectors":["statistics-click"],"selector":"div[class*=\"styles__StyledWidget\"]","type":"SelectorElement"},{"clickElementSelector":"a:contains(\"Statistics\")","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":"1200","discardInitialElements":"do-not-discard","id":"statistics-click","multiple":true,"parentSelectors":["match-click"],"selector":"_parent_","type":"SelectorElementClick"},{"clickElementSelector":"button[class*=\"styles__ShowMoreButton\"]","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickMore","delay":"1200","discardInitialElements":"do-not-discard","id":"show-more","multiple":true,"parentSelectors":["_root"],"selector":"div[class*=\"js-list-cell-target\"]","type":"SelectorElementClick"},{"delay":"1200","id":"scroll-down","multiple":true,"parentSelectors":["_root"],"selector":"html","type":"SelectorElementScroll"},{"clickElementSelector":"div[class*=\"js-list-cell-target\"]","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":"1200","discardInitialElements":"discard-when-click-element-exists","id":"match-click","multiple":true,"parentSelectors":["_root"],"selector":"html","type":"SelectorElementClick"}]}

1 Like

Hi @ViestursWS ,thank you so much for your help. The example will help me a lot. Thanks again