JAVA爬虫学习jsoup

时间:2022-10-31 11:11:38
首先添加maven依赖
<dependency>
   <groupId>org.jsoup</groupId>
   <artifactId>jsoup</artifactId>
   <version>1.10.3</version>
  </dependency>

核心代码

Document objectDoc = Jsoup.connect("http://www.xxx.cn/20170725-n3-20170725160315487779.html")
     .cookie("infopass", "waming1234")
     .cookie("EEAkIjcBEarJg", "wmhq2018")
     .cookie("myuniseqid", "e1c26f59cbc13163f15a53d4f3e34351")
     .cookie("PHPSESSID", "d7mjliobrd49s4ncisu4o77gi5")
     .get();