A
A
artshelom2016-10-07 22:37:27
Java
artshelom, 2016-10-07 22:37:27

Java how to make page scroll?

I wrote the code to open the page, is it possible to send a request to the site to scroll the site??
Will it depend on the site?

URL url = new URL("https://www.instagram.com/explore/tags/privet/");
        URLConnection connection = url.openConnection();
        BufferedReader reader = new BufferedReader
                (new InputStreamReader(connection.getInputStream()));
        String line = null;
        while ( ( line = reader.readLine() ) != null ) {
            System.out.println(line);
        }
        reader.close();

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rou1997, 2016-10-07
@artshelom

No, you can’t, the abstract concept of scrolling a window with a document is only in the Browser object model (JavaScript), that is, only in the browser, so you either need a browser and it will minimally depend on the site, or you need to find out what exactly happens when scrolling and send such HTTP -request to the server, this requires a sniffer, Wireshark, Fiddler, Charles or Web inspector (DevTools in the browser).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question