Hey! For colab scrape images from website python, I'd recommend using `requests` + `BeautifulSoup`. Here's a quick snippet that works in Colab:
```python
import requests
from bs4 import BeautifulSoup
import os
url = "your_target_website"
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
images = soup.find_all('img')
for img in images:
img_url = img['src']
img_data = requests.get(img_url).content
with open(os.path.basename(img_url), 'wb') as f:
f.write(img_data)
```
For lazy loading, you might need Selenium. Colab has it preinstalled, so just `!apt install chromium-chromedriver` and you're good to go!
```python
import requests
from bs4 import BeautifulSoup
import os
url = "your_target_website"
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
images = soup.find_all('img')
for img in images:
img_url = img['src']
img_data = requests.get(img_url).content
with open(os.path.basename(img_url), 'wb') as f:
f.write(img_data)
```
For lazy loading, you might need Selenium. Colab has it preinstalled, so just `!apt install chromium-chromedriver` and you're good to go!
