I've been scraping this website for a year now, however they recently changed the layout of the website and for some reason I can't make it work anymore. I'm using Python and BeautifulSoup.
I'm basically trying to get the data in the tables from this link: https://www.loto.ro/?p=3872
This is the code that used to work with the old layout and I adapted it for the current layout of the website:
website_result = requests.get("https://www.loto.ro/?p=3872")
src = website_result.content
soup = BeautifulSoup(src, 'lxml')
for i in range(0, 8):
table_title = soup.select(".content .content-info .rezultate-extrageri-content.resultDiv .button-open-details")[i].get_text().strip()
if "6/49" in table_title:
images = soup.select(".content-info .rezultate-extrageri-content.resultDiv "
".info-rezultat .numere-extrase img[src]")
if len(images) > 0:
table = soup.select(".content .content-info .rezultate-extrageri-content.resultDiv .results-table")[i]
In debug mode, my code gets stuck at the "table_title" line without giving me any error or traceback so I don't even know what the problem is.
Any ideas? Thanks.