'Scrapy-Splash: Cannot click buttons with lua script
I am scraping data from grammy.com and I would like to expand tabs containing the information related to Grammy Awards (Image enclosed below).
I wrote a lua script to go through and click all the buttons but there does not seem to be any change to the html I received. Here is the sample page and the lua script is as follows:
function main(splash)
assert(splash:go(splash.args.url))
splash:set_viewport_full()
assert(splash:wait(1))
local btn = splash:select_all('button[class^=cursor-pointer]')
for key , value in pairs(btn) do
value:click()
splash:wait(2)
end
return {
html = splash:html(),
png = splash:png(),
}
end
Any help is much appreciated. Thank you in advance.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

