jsonContext = JsonPath.parse(jsonString);
List<String> data = jsonContext.read("$.[?(@.acc != 'Not Found')].acc");
assertThat(data, notNullValue());
assertThat(data.size(), greaterThan(0));
System.err.println("Results: " + data);
Results: ["3asdasd321asdasdfsadf2","1asdasd121asdasdfsadf5"]
disired_capabilities = DesiredCapabilities.CHROME
disired_capabilities['loggingPrefs'] = {
'browser':'ALL'
}
driver = webdriver.Chrome(executable_path = chromedriver_path, desired_capabilities = disired_capabilities)
PATH
и JAVA_HOME
update-alternatives(1) dpkg utilities update-alternatives(1)
NAME
update-alternatives - maintain symbolic links determining default com‐
mands
update-alternatives(8) System manager's Manual
NAME
alternatives - maintain symbolic links determining default commands
[
'//a[contains(@href,"{}")]'.format(url_fragment.lower()),
'//a[contains(translate(@href, "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), "{}")]'.format(url_fragment.upper())
]
length = len(xpaths)
for cnt in range(length):
xpath = xpaths[cnt]
print('# try {}'.format(cnt))
element = None
try:
element = driver.find_element_by_xpath(xpath)
except InvalidSelectorException, e:
print('Exception (ignored): {}'.format(e))
pass
except NoSuchElementException, e:
print('Exception (ignored): {0}'.format(e))
pass
if element != None:
print('Found via {}'.format(xpath))
print(element.get_attribute('outerHTML'))
else:
print('Failed via {}'.format(xpath))
List<String> names = new ArrayList<>(
Arrays.asList(new String[] { "ильф", "петров" }));
POST
tohttp://127.0.0.1:55105/session/4efe9b351b24b0869d34bf24ca45af0e/chromium/send_command_and_get_result
params: {"cmd": "Page.captureScreenshot", "params": {"clip": {"x": 32, "y": 469, "width": 235, "height": 76, "scale": 1}}}
...
return base64.b64decode(response['value']['data'])
viewport
будет свой) script = "return window.getComputedStyle(arguments[0],':after')";
display.stop()
browser.close()
browser.quit()
DATAFILE1="/tmp/data1.$$"
# NOTE: do not use | as a separator
cat<<EOF>$DATAFILE1
first:11:second:12:third:13
first:22:second:22:third:23
first:32:second:32:third:33
EOF
1>&2 echo 'Loading:'
1>&2 cat $DATAFILE1
1>&2 echo '---'
DATAFILE2="/tmp/data2.$$"
DATAFILE2="/tmp/data.tmp.json"
IFS=':'; cat $DATAFILE1| while read KEY1 VALUE1 KEY2 VALUE2 KEY3 VALUE3; do
jq --arg k1 "$KEY1" \
--arg v1 "$VALUE1" \
--arg k2 "$KEY2" \
--arg v2 "$VALUE2" \
--arg k3 "$KEY3" \
--arg v3 "$VALUE3" \
'. | .[$k1]=$v1 | .[$k2]=$v2 | .[$k3]=$v3' \
<<<'{}' ;
done > $DATAFILE2
DATA_KEY='data'
# making the rowset keyed by $DATA_KEY
# TODO: explore alternatives
cat $DATAFILE2 | jq --slurp '.' | jq "{\"$DATA_KEY\": .}"
Loading:
first:11:second:12:third:13
first:22:second:22:third:23
first:32:second:32:third:33
---
{
"data": [
{
"first": "11",
"second": "12",
"third": "13"
},
{
"first": "22",
"second": "22",
"third": "23"
},
{
"first": "32",
"second": "32",
"third": "33"
}
]
}
docker run -v ${HOME}/Desktop/:/var/properties -p 8086:8080 basic-example
curl http://localhost:8085/basic
Hello some value
sed -i 's|some value|some other value|' ~/Desktop/application.properties
curl http://localhost:8085/basic
Hello some other value