Skip to Content
Mastering Python for Networking and Security
book

Mastering Python for Networking and Security

by José Manuel Ortega
September 2018
Intermediate to advanced
426 pages
10h 46m
English
Packt Publishing
Content preview from Mastering Python for Networking and Security

Extracting metadata from web images

In this section, we are going to build a script to connect to a Website, download all the images on the site, and then check them for Exif metadata.

For this task, we are using the urllib module from python3 that provides parse and request packages:

https://docs.python.org/3.0/library/urllib.parse.html

https://docs.python.org/3.0/library/urllib.request.html

You can find the following code in the exif_images_web_page.py file in the exiftags folder.

This script contains the methods for find images in a website with BeautifulSoup and the lxml parser, and download images in an images folder:

def findImages(url):    print('[+] Finding images on ' + url)    urlContent = requests.get(url).text soup = BeautifulSoup(urlContent,'lxml') ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Python for Networking and Security - Second Edition

Mastering Python for Networking and Security - Second Edition

José Manuel Ortega
Python for Cybersecurity

Python for Cybersecurity

Howard E. Poston, III

Publisher Resources

ISBN: 9781788992510Supplemental Content