From the course: Scripting for Testers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Find duplicate URLs

Solution: Find duplicate URLs - Python Tutorial

From the course: Scripting for Testers

Start my 1-month free trial

Solution: Find duplicate URLs

- [Instructor] Hopefully, before you watched this, you've tried to solve the challenge on your own. The best way to learn anything is by doing it, and this is especially true in computer programming. I very strongly urge you to give the challenge an honest try and do some googling if you're stuck, before watching this. I think this first challenge wasn't too hard, but some of the future challenges will get a bit harder. So it is worth your time to understand well what is going on with this one. All right. Let's take a look at how I went about solving it. In the exercise file, we were given the URL that we needed. And so, the first thing we need to do is use requests.get to get that URL. So we'll do requests.get(url), and that will read the data into a response variable. Now, let's save that data into another variable, the JSON of it, into this JSON data variable, that we can then use down here. So the next thing we need to do is to read the URLs out of the JSON data into our URL list.…

Contents