0

I have a python script that uses Splinter to interact with a webpage. There's a form on the page that I want to submit, but there's no button element to submit it. Instead, there's a piece of javascript that runs when the button is clicked. I tried to run the javascript in my python program using browser.execute_script, but it says the function is undefined. Here's the tag that the button is in:

<a name="DERIVED_SSS_SCT_SSR_PB_GO" id="DERIVED_SSS_SCT_SSR_PB_GO" ptlinktgt="pt_peoplecode" 
tabindex="114" href="javascript:submitAction_win0(document.win0,'DERIVED_SSS_SCT_SSR_PB_GO');" 
class="SSSBUTTON_CONFIRMLINK">Continue</a>

So I tried browser.execute_script("submitAction_win0(document.win0, 'DERIVED_SSS_SCT_SSR_PB_GO');") but it said submitAction was undefined. I found the function defined a bit further up in the html in the head. How can I execute the javascript? Btw the form name is win0.

Thanks

Joshin
  • 299
  • 1
  • 3
  • 14

1 Answers1

0

Have you tried to find the a element and then click it? Like:

browser.find_by_id("DERIVED_SSS_SCT_SSR_PB_GO").click()
Hugo Lopes Tavares
  • 28,528
  • 5
  • 47
  • 45