From ddd7b9952cb6e0cc9b1bc6b072c4f46002886820 Mon Sep 17 00:00:00 2001 From: Marek Kadek Date: Sat, 29 Oct 2016 11:29:21 +1300 Subject: [PATCH] use different site for checking ip --- .../scrawler/crawlers/JsoupProxyPickingTest.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/scrawler/src/test/scala/com/marekkadek/scrawler/crawlers/JsoupProxyPickingTest.scala b/modules/scrawler/src/test/scala/com/marekkadek/scrawler/crawlers/JsoupProxyPickingTest.scala index 49b5781..c6ee84b 100644 --- a/modules/scrawler/src/test/scala/com/marekkadek/scrawler/crawlers/JsoupProxyPickingTest.scala +++ b/modules/scrawler/src/test/scala/com/marekkadek/scrawler/crawlers/JsoupProxyPickingTest.scala @@ -9,8 +9,8 @@ import fs2._ sealed class WhatsMyIpChecker(browsers: Seq[Browser[Task]])(implicit S: Strategy) extends Crawler[Task, String](browsers) { override protected def onDocument(document: Document): Stream[Task, Yield[String]] = { - document.root.select("span#ip").headOption match { - case Some(x) => Stream.emit(YieldData(x.text)) + document.root.select("h1.ip > input").headOption.flatMap(_.attr("value")) match { + case Some(x) => Stream.emit(YieldData(x)) case None => Stream.empty } } @@ -23,7 +23,7 @@ class JsoupProxyPickingTest extends ScrawlerTest { implicit val strategy: Strategy = Strategy.fromFixedDaemonPool(8) - val whatsmyip = "http://www.whatsmyip.org" + val whatsmyip = "http://whatsmyip.net/" // from http://proxylist.hidemyass.com val proxies: Seq[ProxySettings] = Seq(