Skip to content
Advertisement

How to filter some urls from python list?

I wrote this code for extract images urls from a web page as I given. And it shows all images urls. But I need to filter “https://images.unsplash.com/profile” urls and print them.

JavaScript

I tried;

JavaScript

And didn’t worked!

Advertisement

Answer

You need to iterate through the images and then look if each of the image within images contains the required string or not.

JavaScript

output –

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement