Beginner : Click on botton of the popup, and creating database

Hello,
I'm trying to make a database of the win for life results.
The url target is Win for life (10/20): All Results | LotoStats.ro .
The first problem is that when url is accesed with selenium, everytime it appears this popup :

html :

Gestionați opțiunile De acord și continuă

So my first problem as a begginer is that I dont know how to click the right button ( I need to click the second one : >De acord și continuă< .
The second problem is that I dont know how to get the date,hour and the numbers because they are structured like this:

Date / Hour
Numbers / Numerone
2022-07-12 / 11:00 2, 3, 5, 10, 12, 13, 15, 16, 18, 20 (10)
2022-07-12 / 10:00 1, 6, 8, 11, 13, 14, 16, 17, 18, 19 (5)
2022-07-12 / 09:00 1, 3, 4, 6, 8, 11, 13, 14, 17, 20 (14)
2022-07-12 / 08:00 1, 2, 3, 5, 6, 8, 11, 14, 16, 18 (5)
2022-07-11 / 24:00 3, 6, 7, 8, 10, 11, 12, 13, 18, 19 (5)
2022-07-11 / 23:00 2, 3, 4, 5, 11, 12, 13, 15, 17, 20 (2)
2022-07-11 / 22:00 2, 5, 6, 7, 8, 9, 12, 14, 17, 19 (5)
2022-07-11 / 21:00 2, 8, 9, 10, 11, 13, 15, 17, 18, 20 (10)
2022-07-12 / 12:00 1, 3, 4, 5, 6, 8, 9, 14, 15, 16 (20)
2022-07-11 / 20:00 4, 5, 6, 7, 9, 11, 12, 13, 17, 19 (17)
2022-07-11 / 19:00 3, 5, 6, 7, 8, 11, 15, 16, 19, 20 (14)
2022-07-11 / 18:00 4, 5, 6, 7, 8, 12, 14, 15, 16, 20 (10)
2022-07-11 / 17:00 1, 3, 4, 5, 7, 9, 11, 12, 13, 20 (4)
2022-07-11 / 16:00 1, 2, 6, 7, 12, 13, 14, 15, 16, 17 (14)
2022-07-11 / 15:00 4, 5, 7, 8, 9, 12, 13, 17, 18, 19 (14)
2022-07-11 / 14:00 3, 6, 7, 8, 9, 13, 16, 18, 19, 20 (3)
2022-07-11 / 13:00 4, 7, 9, 11, 13, 15, 16, 18, 19, 20 (5)
2022-07-11 / 12:00 1, 4, 6, 7, 8, 9, 11, 14, 19, 20 (15)
2022-07-11 / 11:00 1, 2, 3, 4, 5, 6, 7, 12, 13, 19 (6)
2022-07-11 / 10:00 2, 4, 5, 6, 7, 9, 11, 12, 14, 20 (3)

And the third problem that I have is that I dont know how to click the 2nd, 3rd and so one page.
"2"

For the click page I've tryed:

driver = Chrome(executable_path="C:/Users/talls/Desktop/Python/Web scraping/chromedriver.exe", options=options)
driver.get("Win for life (10/20): All Results | LotoStats.ro")
delay = 10 # seconds
time.sleep(10)
driver.find_element("xpath",'//a[@data-dt-ids="3"]').click()

and the error:

NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//a[@data-dt-ids="3"]"}
(Session info: chrome=103.0.5060.114)

Please help !
Thank you!

@tibster Hello, could you give us an example of how the final output should look like?

If you are looking to extract the lucky numbers + date/time you could use the following sitemap:

{"_id":"en-lotostats-ro","startUrl":["https://en.lotostats.ro/results-win-for-life-10-20"],"selectors":[{"delay":0,"id":"wrapper","multiple":true,"parentSelectors":["_root"],"selector":"#product_list tr","type":"SelectorElement"},{"delay":0,"extractAttribute":"","id":"date/hour","parentSelectors":["wrapper"],"selector":"td.widthrsp > div:nth(0), td.widthrsp > div:nth(1)","type":"SelectorGroup"},{"delay":0,"extractAttribute":"","id":"numbers","parentSelectors":["wrapper"],"selector":"td:nth-of-type(2) div:nth-of-type(n+2)","type":"SelectorGroup"}]}

Something like this in a csv file


And the url is Win for life (10/20): All Results | LotoStats.ro

@tibster You will have to create a separate selector based on it's order in the HTML using nth-of-type selectors.

Learn more: Selectors | jQuery API Documentation

Example:

{"_id":"en-lotostats-rt","startUrl":["https://en.lotostats.ro/results-win-for-life-10-20"],"selectors":[{"delay":0,"id":"wrapper","multiple":true,"parentSelectors":["_root"],"selector":"#product_list tr","type":"SelectorElement"},{"delay":0,"id":"date","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"td.widthrsp > div:nth(0), td.widthrsp > div:nth(1) div:nth(0)","type":"SelectorText"},{"delay":0,"id":"hour","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":".widthrsp div:nth-of-type(2)","type":"SelectorText"},{"delay":0,"id":"number-1","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"div.blaresp:nth-of-type(2)","type":"SelectorText"},{"delay":0,"id":"number-2","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"div:nth-of-type(3)","type":"SelectorText"},{"delay":0,"id":"number-3","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"div:nth-of-type(4)","type":"SelectorText"},{"delay":0,"id":"number-4","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"div:nth-of-type(5)","type":"SelectorText"},{"delay":0,"id":"number-5","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"div:nth-of-type(6)","type":"SelectorText"},{"delay":0,"id":"number-6","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"div:nth-of-type(7)","type":"SelectorText"},{"delay":0,"id":"number-7","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"div:nth-of-type(8)","type":"SelectorText"},{"delay":0,"id":"number-8","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"div:nth-of-type(9)","type":"SelectorText"},{"delay":0,"id":"number-9","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"div:nth-of-type(10)","type":"SelectorText"},{"delay":0,"id":"number-10","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"div:nth-of-type(11)","type":"SelectorText"},{"delay":0,"id":"lucky-number","multiple":false,"parentSelectors":["wrapper"],"regex":"","selector":"div.blarespred","type":"SelectorText"}]}