Pep8 fixes
New version of the script working correctly in AutomatorTest.
Time to test it in Mediawiki.
Fix search condition logic