P
P
pozhigun2019-09-09 20:15:49
Java
pozhigun, 2019-09-09 20:15:49

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

1 answer(s)
S
Sergey Gornostaev, 2019-09-09
@pozhigun

How to parse without a ban?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question