I did many things and I frustrated I know there is a small issue because of low experience.
please provide help if you know the answer.
`script = “””
function main(splash, args)
splash.private_mode_enabled = false
splash:set_custom_headers(args.headers)
assert(splash:go(args.url))
splash:wait(2)
local button = splash:select(‘#gallery > button:nth-child(2)’)
if not button then
return {error = ‘Button not found’, html = splash:html()}
end
button:mouse_click()
splash:wait(2) — Wait for images to load after clicking the button
return {html = splash:html()}
end
"""
# Click the button to load images (if applicable)
headers = self.settings.getdict('DEFAULT_REQUEST_HEADERS')
yield SplashRequest(response.url, self.parse_images, endpoint='execute',
args={'lua_source': script}, meta={'items': items}, headers=headers)`
do not worry about indentation just focus on the code.
I have run the code and I got this error.
{"error": 400, "type": "BadOption", "description": "Incorrect HTTP API arguments", "info": {"type": "argument_required", "argument": "lua_source", "description": "Required argument is missing: lua_source"}}
but I am sure in my code at the every time i provided the lua_script what should I do?