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


java image selenium

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Selenium Online Training- Selenium Course with live Project| OnlineITGuru

Software company need expert with selenium certification. Learn best Java concepts in selenium training and become a testing engineer.

Selenium Framework using Java | Selenium Tutorial | Selenium Training

Selenium Frameworks are used to optimize the code structure and help in code maintenance. Selenium Framework using Java will help you learn how the three common Selenium frameworks can be created.

Selenium Tool Suite - Components and Features

Learn about selenium tool suite - See its components like Selenium IDE, Selenium Remote control, webdriver & selenium grid with their features & limitations

What Is Selenium? How Selenium Works? Selenium Basics & More

Selenium automates web testing of by controlling browsers based on your test scripts. Learn what is Selenium? Why is Selenium testing important? How Selenium works? What are Selenium Components? How to start Selenium testing?

Java Core (2020) | Java for beginners | Brush up your Java Skills | Get Hired

In this video we will learn about all the major concepts that come under Java Core . The course is very carefully designed and is made with keeping simplicit...