Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium Python Javascript Execution

I have the problem of running this. I get back an error stating that I either am missing a ) after arguments or that I have an illegal character. I understand that it must be thinking that I am trying to insert an argument when I am not. I believe I just need help with the syntax.

    browser.execute_script("url = '/Administration/SwitchCompany?' + jQuery.param({CompanyId: $('#companyDropDownList option:contains('DTLTest')').val() })")

browser.execute_script("$('#userInfoPlaceholder').load(url, switchCompanyCallback);" )

1 Answers

Did you mean

browser.execute_script("$('#userInfoPlaceholder').load(url, switchCompanyCallback);" )

Change of # to $

like image 159
Amey Avatar answered Sep 07 '26 16:09

Amey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!