Judge
Crawlipt provides two keywords, if and check, combined with the condition method to make logical judgments before executing the action method.
'If' keyword
{
"method": "input",
"xpath": "//*[@id=\"kw\"]",
"text": "your search text",
"if": {
"condition": "presence",
"xpath": "//*[@id=\"su\"]"
}
}'check' keyword
{
"method": "input",
"xpath": "//*[@id=\"kw\"]",
"text": "your search text",
"check": {
"condition": "presence",
"xpath": "//*[@id=\"su\"]"
}
}
//Equivalent to
{
"check": {
"condition": "presence",
"xpath": "//*[@id=\"su\"]"
},
"next": {
"method": "input",
"xpath": "//*[@id=\"kw\"]",
"text": "your search text"
}
}Last updated