Good day. Please tell me how to collect information about points at the following link (https://www.sofascore.com/en-us/tennis/match/bolelli-querrey/bggskgg#id:6871051) (see photo). Most of the information can be collected (name, rating, total score, time, etc.) but I could not collect points
Hi, the data is hardcoded in the HTML, thus there should be no issue scraping it. The question is how would you like for it to be structured in the output file?
1 Like
Using the first set as an example:
1set1game - 15-0,30-0,40-0
1set2game - 15-0,15-15,15-30,15-40
1set3game - 15-0,30-0,40-0,40-15
And so on with the following games and sets
The values could be scraped like this, but it will require quite a lot of post-processing to make the data readable:
{"_id":"sofascore","startUrl":["https://www.sofascore.com/en-us/tennis/match/bolelli-querrey/bggskgg#id:6871051"],"selectors":[{"clickActionType":"real","clickElementSelector":"div[direction=\"column\"] [cursor=\"pointer\"]:contains('set'):not(:has(+ div))","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":0,"discardInitialElements":"discard-when-click-element-exists","id":"open-all-sets","multiple":false,"parentSelectors":["_root"],"selector":"body","type":"SelectorElementClick"},{"id":"1set","multiple":true,"parentSelectors":["_root"],"selector":"div[class=\"Box fTPNOD\"]:contains('1st set')","type":"SelectorElement"},{"extractAttribute":"","id":"1set1game","parentSelectors":["1set"],"selector":"div:nth-of-type(3) div.IBiIm > div div","type":"SelectorGroup"}]}
1 Like
Thanks, can you add some more games? So that I understand the algorithm
sure:
{"_id":"sofascore","startUrl":["https://www.sofascore.com/en-us/tennis/match/bolelli-querrey/bggskgg#id:6871051"],"selectors":[{"clickActionType":"real","clickElementSelector":"div[direction=\"column\"] [cursor=\"pointer\"]:contains('set'):not(:has(+ div))","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":0,"discardInitialElements":"discard-when-click-element-exists","id":"open-all-sets","multiple":false,"parentSelectors":["_root"],"selector":"body","type":"SelectorElementClick"},{"id":"1set","multiple":true,"parentSelectors":["_root"],"selector":"div[class=\"Box fTPNOD\"]:contains('1st set')","type":"SelectorElement"},{"extractAttribute":"","id":"1set1game","parentSelectors":["1set"],"selector":"div:nth-of-type(3) div.IBiIm > div div","type":"SelectorGroup"},{"extractAttribute":"","id":"1set2game","parentSelectors":["1set"],"selector":"div:nth-of-type(4) div.IBiIm > div div","type":"SelectorGroup"},{"extractAttribute":"","id":"1set3game","parentSelectors":["1set"],"selector":"div:nth-of-type(5) div.IBiIm > div div","type":"SelectorGroup"},{"id":"2set","multiple":true,"parentSelectors":["_root"],"selector":"div[class=\"Box fTPNOD\"]:contains('2nd set')","type":"SelectorElement"}]}
1 Like
Thank you very much for your help

