Originally created by: PierreBrisorgueil
I have about fifteen scrapings that run from a global point of view I observe that it really complicates my code.
Examples:
really simple things, which become quite complicated ... I have to play with loops ...
LET test = INNER_TEXT(element) != $ ? 1 : 0
LET action = (
FOR i in 1.. test
......
RETURN true
)
It really complicates the job ...
are there other possibilities? or can we consider a feature in this sense?
The more I have experienced ferret for a year, the more I have to go to this kind of test for complicated sites and production usages
Originally posted by: PierreBrisorgueil
@ziflex same idea for try catch to handle exceptions :
Originally posted by: ziflex
I wonder if pattern matching would be better for it? We would get logical branching and keep declarative feel of the language.
Originally posted by: PierreBrisorgueil
hmm, that could be a solution. But what would that give for a try-catch?
Afterward, I am hesitant, for "if else" it would be consistent for ferret, but spontaneously when two friends tested ferret, they always asked first how to do an "if else".
Everyone knows "if else" everywhere, even in excel. It can be interesting for "onBoarding" to have both. If I had to keep just one I think I would stay on the "if else" for that aspect.
Originally posted by: PierreBrisorgueil
@ziflex Another use case, a form leads to the results page, it would be good to be able to exit the code with an if else, if a "no result" is displayed before a WAIT_ELEMENT of the results
(one page site)
75 lines of result treatment in this tricks to deal with it
Originally posted by: ziflex
Alternative solution could be adding a support of workflow - a tree of scripts that are executed within same context where you can branch the execution flow.