test_issue409

master
yihua.huang 2017-06-03 15:02:33 +08:00
parent fb0acd710c
commit 4cd5b4f93e
1 changed files with 8 additions and 7 deletions

View File

@ -5,8 +5,6 @@ import org.junit.Test;
import us.codecraft.webmagic.model.AfterExtractor; import us.codecraft.webmagic.model.AfterExtractor;
import us.codecraft.webmagic.model.annotation.ExtractBy; import us.codecraft.webmagic.model.annotation.ExtractBy;
import static org.assertj.core.api.Assertions.assertThat;
/** /**
* @author code4crafter@gmail.com * @author code4crafter@gmail.com
* Date: 2017/6/3 * Date: 2017/6/3
@ -79,13 +77,16 @@ public class SimpleHttpClientTest {
} }
} }
@Ignore
@Test @Test
public void test() throws Exception { public void test() throws Exception {
SimpleHttpClient simpleClient = new SimpleHttpClient(Site.me().setUserAgent( // SimpleHttpClient simpleClient = ;
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36")); // Weather weather = simpleClient.get("http://www.weather.com.cn/weather/101020100.shtml", Weather.class);
Weather weather = simpleClient.get("http://www.weather.com.cn/weather/101020100.shtml", Weather.class); // assertThat(weather).isNotNull();
assertThat(weather).isNotNull(); }
@Ignore
@Test
public void test_issue409() throws Exception {
System.out.println(new SimpleHttpClient(Site.me()).get("https://www.beijing-hyundai.com.cn").getHtml());
} }
} }