Answer the question
In order to leave comments, you need to log in
How to parse multiple sites?
The task is to extract some text corresponding to a specific request from various sites. For example, there are websites dictionaries, explanatory dictionaries. Further extraction of the term of a certain word. For individual sites, you can do, that is, search for certain tags, but the same code will not work for different sites. How to make the same code parse different sites at a more or less normal level?
Answer the question
In order to leave comments, you need to log in
In Java, I recommend Jsoup for parsing .
Installation via maven:
<dependency>
<!-- jsoup HTML parser library @ http://jsoup.org/ -->
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.10.2</version>
</dependency>
The same code will not parse different sites in the same way, since you are parsing by html tags or xml markup, it doesn’t matter, the important thing is that you are tied to specific object names, and they are different on different sites
. And you can use Jsoup for parsing!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question