What's the best way to Web scrape images from HTML? or How can I Web scrape images from HTML efficien

22 Replies, 744 Views

If you’re on Python, `requests-html` is a gem. It’s like BeautifulSoup but with JS support built-in.

```python
from requests_html import HTMLSession

session = HTMLSession()
r = session.get('your_url')
r.html.render() # This handles JS

for img in r.html.find('img'):
print(img.attrs['src'])
```

Super simple for lazy-loaded images.

Messages In This Thread



Users browsing this thread: 1 Guest(s)