Recently in a soccer data crawler, connected to a popular football score live platform site. The method is simple in the process of crawling. Open the Web address and enter developer mode to view its data loading.found that the score data is used to obtain the platform JS file from the server download and then execute JS to show the score.Use the Jsoup open source framework to get it, and set the header app
know that the problem is coding, and then we're going to encode the content that's crawled.
Implementation in Java is simple, just specify the encoding in the InputStreamReader:
Initializes the BufferedReader input stream to read the response of the URLin = new BufferedReader (New InputStreamReader (Connection.getinputstream (), "UTF-8"));
When you run the program again, you will see that the title is displayed correctly:
Good! Very good!
But
This is my reference to some information on the Web to write the first Java crawler program
Originally want to get fried egg net boring picture, but the network return code is always 503, so changed the site
* * * Web crawler FETCH DATA * */public class Jiandan {public sta
Java to the final exam, the teacher unexpectedly said no test volume, we write procedures to grade ... I'm not a little defensive ...
Anyway, I'm going to write a Baidu stick crawler to him, in order to facilitate the use of Jsoup to parse crawl.
Use our school bar to carry out the experiment (Guilin University of Technology), this is just a simple test, do not like to spray.
Use Jsoup to parse the crawl.
file name when saving based on Web page URLSavetolocalnewfile (Responsebody, path,name+type); } Catch(HttpException e) {//A fatal exception may be the protocol is wrong or the content returned is problematicSystem.out.println ("Please check your provided HTTP address!"); E.printstacktrace (); } Catch(IOException e) {//Network exception occurredE.printstacktrace (); } finally { //Release Connectiongetmethod.releaseconnection (); }
The first section,HttpClientI.introduction of HttpClientThe Hypertext Transfer Protocol "theHyper-text Transfer Protocol (HTTP)" is the most important (significant) protocol used on the internet today,More and more Java applications need to access network resources directly through the HTTP protocol.While the basic functionality of accessing the HTTP protocol has been provided in the Java NET package of the
Build an SSH framework more elegantly (configured using java) and build an ssh framework java
The times are constantly improving, and the disadvantages of a large number of xml-based configurations are also obvious. In addition to XML configuration and direct annotation-based configuration, there is also an interesting
Java, which has a Servlet API, and Ruby has Rack.These theories are good, but I bet you're saying, "Show me the code!," Okay, let's take a look at this very small WSGI server implementation:# # # Use Python 2.7.9, test under Linux and Mac OS X via import socketimport stringioimport sysclass wsgiserver (object): Address_fam ily = socket.af_inet Socket_type = socket. Sock_stream request_queue_size = 1 def __init__ (self, server_address): # # # Create a
process of building the forum system, I hope that the new web development of the students have been helpful.What Web 框架 is the difference between a web framework and a Web server (Nginx, Apache, etc.) that we often hear about Django, Flask these Python languages, and what is the framework? Can I leave the framework an
[Reading Notes] 2016.12.10 "building high-performance Web sites" to build high-performance web Sites
Address of this Article
Sharing outline:
1. Overview
2. knowledge points
3. Waiting for sorting
4. References
1. Overview
1.1) [Book Information]
Building a high-performance Web site:
-- Baidu encyclopedia
--
services.Dropwizard: A Web framework that favors its own use. Used to build Web applications using jetty, Jackson, Jersey, and metrics.Jersey:jax-rs reference implementation.Resteasy: A portable implementation that is fully certified by the JAX-RS specification.Retrofit: A Java type-safe rest client.Spark: A
(Serviceexception e) {E.printstacktrace ();}Log.error ("Call SayHello service error!");}/*** Call two methods* @param args*/public static void Main (string[] args) {Testservice tester = new Testservice ();Tester.callsayhello ();Tester.callsayhellotoperson ();}}Will print out:The return value Is:helloThe return value Is:hello SevenIt means the demo has been successful.At this point, if you modify Helloservice.java, when you execute the test class, you can instantly respond to changes in the Hell
APP development solutions. Therefore, this article focuses on the current mainstream development and development practices, the most important choice is the popularity of NLP and Its Application to the extension of multiple Web technologies, in addition, it makes it easy for a small developer to use PhoneGap across multiple mobile platforms.
PhoneGap is a very recent open source framework. It mainly uses the additional suite mode and adds it to the I
Build a docker image to build Tomcat9.0 mirroring (RPM One-click Install Java Environment)Tomcat is a free, open source, lightweight Web server that is commonly used in small and medium-sized enterprises and where concurrent access is low, and is the first choice for developing and debugging JSP programs. The following
Build web services with Globus Toolkit 4 (gt4)
Author: birali hakizumwami
Translator: xzzhouhu
Copyright Disclaimer: Any website authorized by matrix.Be sureThe original source and author information of the article and this statement are displayed as hyperlinks.Author: birali hakizumwami; xzzhouhuAddress: http://www.onjava.com/pub/a/onjava/2005/10/19/constructing-
Quickly build a Web environment Angularjs + EXPRESS3 + Bootstrap3The ANGULARJS experiential Programming series will show you how to build a powerful web front-end system with ANGULARJS. Angularjs is a very good web front-end framework developed by the Google team. Under so m
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.