Skip to content

19. How To's

jmesi edited this page Aug 8, 2024 · 1 revision

Initiating this page to keep a record of tips and tricks other team members might find handy in their work.

  • Embedding a Google Drive Image using HTML

Original URL: https://drive.google.com/file/d/**0B6wwyazyzml-OGQ3VUo0Z2thdmc**/view

You need to copy the ID from the original URL (the characters between the /d/ and /view), and use it in this URL:

https://drive.google.com/uc?export=view&id=**0B6wwyazyzml-OGQ3VUo0Z2thdmc**

  • Downloading multiple images from a list of URLs

  1. Using WGET

Create a folder in your machine.

Place your text file of images URL in the folder.

cd to that folder. Use wget -i images.txt

You will find all your downloaded files in the folder.

  1. Using Python

`import requests

urls = pd.read_csv(r"cat_urls.csv") #save the url list as a dataframe

#putting r before your normal string converts a normal string to a raw string

rows = []

for index, i in urls.iterrows(): rows.append(i[-1]) counter = 0 for i in rows:

file_name = 'cat' + str(counter) + '.jpg'

    print(file_name)
    response = requests.get(i)
    file = open(file_name, "wb")
    file.write(response.content)
    file.close()
    counter += 1`

Clone this wiki locally