在极客时间上学习了思寒老师的appcrawler,添加blackList之后,运行appcrawler时会报错,想问下定义blackList的标准格式。
1,yaml配置文件:
urlWhiteList: []
blackList:
//*[@resource-id='com.aibs:id/action_bar_root']
beforeRestart: []
报错信息:
2020-11-12 15:30:03 INFO [AppCrawler$.186.parseParams] verbose=true
2020-11-12 15:30:03 INFO [AppCrawler$.187.parseParams] set global log level to TRACE
2020-11-12 15:30:03 INFO [AppCrawler$.203.parseParams] Find Conf /Users/yangyang/Work/Test/appcrawler/demo-ori.yml
Exception in thread "main" com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `scala.collection.mutable.ListBuffer` out of START_OBJECT token
at [Source: (StringReader); line: 151, column: 3] (through reference chain: com.testerhome.appcrawler.CrawlerConf["blackList"])
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1342)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1138)
at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1092)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.handleNonArray(CollectionDeserializer.java:332)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:265)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
at com.fasterxml.jackson.module.scala.deser.SeqDeserializer.deserialize(SeqDeserializerModule.scala:78)
at com.fasterxml.jackson.module.scala.deser.SeqDeserializer.deserialize(SeqDeserializerModule.scala:61)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2992)
at com.testerhome.appcrawler.TData$.fromYaml(TData.scala:63)
at com.testerhome.appcrawler.CrawlerConf.load(CrawlerConf.scala:195)
at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:204)
at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:91)
at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)
2, 参考appcrawler-1.4.0.pdf 定义blacklist
urlWhiteList: []
blackList: ["微信", "客服"]
beforeRestart: []
报错信息:
2020-11-12 15:38:57 INFO [AppCrawler$.186.parseParams] verbose=true
2020-11-12 15:38:57 INFO [AppCrawler$.187.parseParams] set global log level to TRACE
2020-11-12 15:38:57 INFO [AppCrawler$.203.parseParams] Find Conf /Users/yangyang/Work/Test/appcrawler/demo-ori.yml
Exception in thread "main" com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of `com.testerhome.appcrawler.Step` (although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('微信')
at [Source: (StringReader); line: 150, column: 13] (through reference chain: com.testerhome.appcrawler.CrawlerConf["blackList"]->com.fasterxml.jackson.module.scala.deser.BuilderWrapper[0])
at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)
at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1342)
at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1031)
at com.fasterxml.jackson.databind.deser.ValueInstantiator._createFromStringFallbacks(ValueInstantiator.java:371)
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromString(StdValueInstantiator.java:323)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromString(BeanDeserializerBase.java:1366)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:171)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:161)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
at com.fasterxml.jackson.module.scala.deser.SeqDeserializer.deserialize(SeqDeserializerModule.scala:78)
at com.fasterxml.jackson.module.scala.deser.SeqDeserializer.deserialize(SeqDeserializerModule.scala:61)
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2992)
at com.testerhome.appcrawler.TData$.fromYaml(TData.scala:63)
at com.testerhome.appcrawler.CrawlerConf.load(CrawlerConf.scala:195)
at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:204)
at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:91)
at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)