'Lua scripts select dropdown
I have a page I am practicing some scraping on and having trouble with the Lua script to select from a drop down.I have been trying for hours now to figure it out. I need to select 8.4 from the elementid right_eye_156 Here is what I have right now which doesnt do anything but select the title of the page.
function main(splash, args)
assert(splash:go(splash.args.url))
local element = splash:select('.element')
return splash:evaljs("document.title")
end
here is the html for the dropdown from the url (https://eoptika.hu/termekek/kontaktlencse/acuvue-oasys-with-hydraclear-plus-6-db-1-2-heti-kontaktlencse.html)
<select class="form-control eye-option select01 mycol-xs-6 right-eye" id="right_eye_156">
<option value="" selected="selected" class="choose">...</option>
<option value="973" class="right">8.4</option>
<option value="5526" class="right">8.8</option>
</select>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
