Answer the question
In order to leave comments, you need to log in
Java site parsing?
Hello, I have a question about web scraping.
I need to parse the site using different links using Jsoup with the addition of HTMLunit.
Parsed from 2 to 10 links then just stops working. The timer has already been set for 5 minutes per link, nothing helps.
Maybe there are other suggestions on how to parse the site through Java.
The code:
public static void main(String[] args) throws Exception {
FileInputStream fis = new FileInputStream("D:\\car.txt");
BufferedReader reader = new BufferedReader(new InputStreamReader(fis));
String strLine;
while ((strLine = reader.readLine()) != null) {
String test = "";
Document document;
document = Jsoup.connect(strLine).get();
Elements elements = document.getElementsByClass("...");
test = elements.text();
System.out.println(test);
System.out.println("Готово!");
Thread.sleep(50000);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question