简体   繁体   中英

How to call javascript function with Python Selenium?

I want to call MapITRFtoWgs84() function multiple times, actually giving input from a text file and write the output to the another text file? I think Selenium is appropirate tool for my goal. How can I do that? Here is the photo of the calling function from chrome console: ss of chrome console

   driver.execute_script("MapITRFtoWgs84()") or 
   driver.execute_script("$.MapITRFtoWgs84()") or 
   driver.execute_script("document.MapITRFtoWgs84()") 

Try any of the above methods, it depends on whether jquery is exported in the page. Else you will get $ not defined error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM