Can't get input stream from url error java

Can't get input stream from url error java

I made a program in selenium that extracts links of some images from a website so after extraction of link i wanted to save all those images in a folder so i wrote a little code for that

I made a program in selenium that extracts links of some images from a website so after extraction of link i wanted to save all those images in a folder so i wrote a little code for that

for(int j=0; j<links.size(); j++) {
                 URL imageURL = new URL(linklist[j]);
                 BufferedImage saveImage = ImageIO.read(imageURL);
                 ImageIO.write(saveImage, "png", new File("C:\\Users\\Dumpty\\Desktop\\Output\\logo-forum"+ j +".png"));
        }

and yeah im using array to store the url's and for confirmation i printed all the links with this code

for(int k=0; k<links.size(); k++) {
            System.out.println(linklist[k]);
        }

all seems to be working fine but in extraction im facing problem, im getting Can't get input stream from URL! Error I also tried this Can't get input stream from URL! Java but it's still not working this is the full view of the error im getting

Exception in thread "main" javax.imageio.IIOException: Can't get input stream from URL!
    at javax.imageio.ImageIO.read(Unknown Source)
    at com.phantomjs.phantomJStest.main(phantomJStest.java:58)
Caused by: java.io.IOException: Server returned HTTP response code: 400 for URL: https://lh3.googleusercontent.com/f_kendBNnYqba-mMV-3ItGZ2zzbChaaV22nE4uaEW92EWtXPzvFYwDk82AKQ6YlOru4=w1440-h620 2x
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
    at java.net.URL.openStream(Unknown Source)
    ... 2 more


Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

How to Display Image and Show Animation using Applet in Java

In this post, we discuss how to display an image and show animation, using an Applet in Java.

Java Fundamentals: Learn Java for absolute beginners |Simpliv

Java Fundamentals: Learn Java for absolute beginners

Java Essentials : Learn Core Java From Basic to Advance

Learn Java Programming Using Practical Assignments. Start Building Back-end Web Applications Robust Test Automation Frameworks By End Of The Course. Learn More!