Powershell: Fire HTML Form Element Javascript with jQuery

$ie.document.Script.execScript(“`$(`”#mytext`”).trigger(`”change`”);”) If you’re tasked with the automation of a form element, you will find that most of the time this manipulation will not fire javascript code necessary to complete your task. Consider a dynamic dropdown box – you make your selection in the first element, and now that you’ve chosen, the second element is populated. With automation you’ll be stuck … Read More

Using Python to make an API call to data.cms.gov

import json,urllib.request response = urllib.request.urlopen(“https://data.cms.gov/resource/qsk8-thmv.json?PRVDR_NUM=01D0026356”).read() obj = json.loads(response.decode(‘utf-8’)) print (obj[0][‘fac_name’]) Here is how to get a response from CMS on a specific CLIA record. Here is the actual table you’re querying. CMS is actually pretty awesome to give access to all of this.

_IELinkClickByText in Powershell v2

function ClickLinkByText ([string]$arg1){ $ie.document.Script.execScript(“(`$(‘*:contains(`”” + $arg1 + “`”):last’)).click();”); while($ie.Busy) { Start-Sleep -Milliseconds 100 } } If you’re using Powershell v2 to automate IE, and the webpage you’re automating has jQuery, try this out.  I’ve been jealous of this function in Autoit, and this is much faster than the “normal” methods to find the link. If you’re on a weak workstation, … Read More