I am trying to click a java script button on a website but it doesn’t work

I clicked the button through this script from lua:

function main(splash)
            splash:init_cookies(splash.args.cookies)
            splash.private_mode_enabled = false
            splash.images_enabled = true  -- Ensure images are loaded
            assert(splash:go{
                splash.args.url,
                headers=splash.args.headers,
            })
            assert(splash:wait(5))  -- Increase wait time to ensure all resources are loaded

            splash:set_viewport_full()  -- Set viewport to full to capture the entire page
            local button = splash:select('html body div#__next div#root_element section.styles_desktop_top-section__ielYe div#gallery.styles_desktop_container__mkdMa div.styles_desktop
            _image--big__wnpkg div.styles_desktop_button__container__
                BMM1C button.button-module_button__06uQ8.button-module_button-theme__Rziix.button-module_button-theme--secondary__-6EDU.button-module_button-size--
                    small__Lg4tu.button-module_button-theme--secondary--with-padding__rXoQh.button-module_button--reduce-padding-prefix__zAU6k')
            
            if button then
                button:mouse_click()
                splash:wait(5)  -- Wait for images to load after clicking the button
            else
                return {
                    error = "Button not found",
                    url = splash:url(),
                    cookies = splash:get_cookies(),
                    html = splash:html(),
                    png = splash:png(),  -- Return the screenshot even if the button is not found
                }
            end

            local screenshot = splash:png()  -- Take a screenshot
            return {
                url = splash:url(),
                cookies = splash:get_cookies(),
                html = splash:html(),
                png = screenshot,  -- Return the screenshot
            }
        end

It is my code to extract images with scrapy

# the code for call parse_images

yield SplashRequest(response.url, self.parse_images, endpoint='execute',
                            args={"lua_source": script}, meta={"items": items}, headers=headers)





def parse_images(self, response):
        items = response.meta['items']

        screenshot_data = response.data['png']
        screenshot_bytes = base64.b64decode(screenshot_data)
        with open('screenshot.png', 'wb') as f:
            f.write(screenshot_bytes)

        if 'error' in response.data:
            self.logger.error(f"Error in Lua script: {response.data['error']}")
        else:
            html = response.data['html']
            soup = BeautifulSoup(html, 'html.parser')

            images = soup.find_all('img')
            lst2 = []
            jpg_pattern = re.compile(r'https://www.propertyfinder.ae/property/[a-zA-Z0-9/-.?=]+')
            for img in images:
                src = img.get('src')
                if src and jpg_pattern.match(src):
                    lst2.append(src)

            items['image_urls'] = lst2

        yield items

I got the screen shot and It show that the click did not happen.

enter image description here

It is the screenshot that I got from my code.

If you can please debug my code the whole last day I was working on it and it remained like this.

Thank you for your help.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật