Hello all,
I'm setting up a scraper to get some historical odds from oddsportal.com.
In a game odds page ~15 bookmakers are displayed by default and there is a link to load more bookmakers. I am using an ElementClickSelector to click the load more link but each time I run the scraper the load more link is indeed clicked, expanding the table, but I'm then redirected to the new account creation page.
Before adding the "more-bookmakers" element click selector and the corresponding "betfair-row" element selector, the rest of the "row" selectors and child selectors worked as intended. Moving the "row" selectors under the "more-bookmakers" always leads to the new account page, regardless of whether "betfair-row" exists or not.
I have tries various combinations of selectors etc for "more-bookmakers", to no avail. So my questions are:
- How do I set up a selector to expand the bookmaker list and then scrape all required rows.
- Hinging on the previous question, after the "Home/Away" tab is scraped, I need to "click" on the "AH" and "O/U" tabs in order for the table to load the corresponding data.
Thanks for your help!
Sitemap:
{"_id":"nba-2020-2021","startUrl":["https://www.oddsportal.com/basketball/usa/nba-2020-2021/results/"],"selectors":[{"delay":0,"id":"game-link","multiple":true,"parentSelectors":["pagination"],"selector":"table#tournamentTable td.name a","type":"SelectorLink"},{"id":"pagination","paginationType":"auto","parentSelectors":["_root","pagination"],"selector":"div#pagination a:nth-of-type(13)","type":"SelectorPagination"},{"delay":0,"id":"date","multiple":false,"parentSelectors":["game-link"],"regex":"","selector":"p.date","type":"SelectorText"},{"delay":0,"id":"score-1q-home","multiple":false,"parentSelectors":["game-link"],"regex":"(?<=\\()[0-9]+(?=:)","selector":"p.result","type":"SelectorText"},{"delay":0,"id":"score-1q-away","multiple":false,"parentSelectors":["game-link"],"regex":"(?<=(\\([0-9]{2}:))[0-9]+","selector":"p.result","type":"SelectorText"},{"delay":0,"id":"score-2q-home","multiple":false,"parentSelectors":["game-link"],"regex":"(?<=(\\([0-9]{2}:[0-9]{2}), )[0-9]+","selector":"p.result","type":"SelectorText"},{"delay":0,"id":"score-2q-away","multiple":false,"parentSelectors":["game-link"],"regex":"(?<=(\\([0-9]{2}:[0-9]{2}), [0-9]{2}:)[0-9]+","selector":"p.result","type":"SelectorText"},{"delay":0,"id":"score-3q-home","multiple":false,"parentSelectors":["game-link"],"regex":"(?<=(\\([0-9]{2}:[0-9]{2}), [0-9]{2}:[0-9]{2}, )[0-9]+","selector":"p.result","type":"SelectorText"},{"delay":0,"id":"score-3q-away","multiple":false,"parentSelectors":["game-link"],"regex":"(?<=(\\([0-9]{2}:[0-9]{2}), [0-9]{2}:[0-9]{2}, [0-9]{2}:)[0-9]+","selector":"p.result","type":"SelectorText"},{"delay":0,"id":"score-4q-home","multiple":false,"parentSelectors":["game-link"],"regex":"(?<=(\\([0-9]{2}:[0-9]{2}), [0-9]{2}:[0-9]{2}, [0-9]{2}:[0-9]{2}, )[0-9]+","selector":"p.result","type":"SelectorText"},{"delay":0,"id":"score-4q-away","multiple":false,"parentSelectors":["game-link"],"regex":"(?<=(\\([0-9]{2}:[0-9]{2}), [0-9]{2}:[0-9]{2}, [0-9]{2}:[0-9]{2}, [0-9]{2}:)[0-9]+","selector":"p.result","type":"SelectorText"},{"delay":0,"id":"score-et-home","multiple":false,"parentSelectors":["game-link"],"regex":"(?<=(\\([0-9]{2}:[0-9]{2}), [0-9]{2}:[0-9]{2}, [0-9]{2}:[0-9]{2}, [0-9]{2}:[0-9]{2}, )[0-9]+","selector":"p.result","type":"SelectorText"},{"delay":0,"id":"score-et-away","multiple":false,"parentSelectors":["game-link"],"regex":"","selector":"p.result","type":"SelectorText"},{"delay":0,"id":"final-score-home","multiple":false,"parentSelectors":["game-link"],"regex":"","selector":".result strong","type":"SelectorText"},{"delay":0,"id":"final-score-string","multiple":false,"parentSelectors":["game-link"],"regex":"","selector":"p.result","type":"SelectorText"},{"delay":0,"id":"pinnacle-row","multiple":false,"parentSelectors":["game-link"],"selector":"tr.lo:has(span.l18)","type":"SelectorElement"},{"delay":0,"id":"pinnacle-odds-ft-home","multiple":false,"parentSelectors":["pinnacle-row"],"regex":"","selector":"td:nth-of-type(2).odds div","type":"SelectorText"},{"delay":0,"id":"1xbet-row","multiple":false,"parentSelectors":["game-link"],"selector":"tr.lo:has(span.l417)","type":"SelectorElement"},{"delay":0,"id":"1xbet-odds-ft-home","multiple":false,"parentSelectors":["1xbet-row"],"regex":"","selector":"td:nth-of-type(2).odds div","type":"SelectorText"},{"delay":0,"id":"unibet-row","multiple":false,"parentSelectors":["game-link"],"selector":"tr.lo:has(span.l5)","type":"SelectorElement"},{"delay":0,"id":"unibet-ft-odds-home","multiple":false,"parentSelectors":["unibet-row"],"regex":"","selector":"td:nth-of-type(2).odds div","type":"SelectorText"},{"clickElementSelector":"div#odds-data-table > div:nth-child(1) > table > tfoot > tr.odd > td > a","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":1000,"discardInitialElements":"do-not-discard","id":"more-bookmakers","multiple":false,"parentSelectors":["game-link"],"selector":"body","type":"SelectorElementClick"},{"delay":0,"id":"betfair-row","multiple":true,"parentSelectors":["more-bookmakers"],"selector":"tr.lo:has(span.l429)","type":"SelectorElement"},{"delay":0,"id":"betfair-odds-ft-home","multiple":false,"parentSelectors":["betfair-row"],"regex":"","selector":"td:nth-of-type(2).odds div","type":"SelectorText"}]}