How to web scrape images from HTML using BS4?

13 Replies, 2269 Views

What’s up folks!

When identifying image tags in HTML, look for the `<img>` tag.

You should focus on attributes like `src` for the image URL and `alt` for descriptions. Here's a quick code snippet:

```python
images = soup.find_all('img')
for img in images:
print(img['src'])
```

This will give you all the image URLs on the page.

Messages In This Thread



Users browsing this thread: 1 Guest(s)