Search code examples
python-3.xpython-requests-html

Python Requests-HTML extracting SRC


wondering if anyone can help. I've searched the docs for requests-html but no luck https://requests.readthedocs.io/projects/requests-html/en/latest/

Previously I was using requests and beautiful soup but the website I'm scraping has now implemented javascript. I've managed to extract text using Requests-HTML but am unsure of how to extract image SRC

from requests_html import HTMLSession

session = HTMLSession()
R = session.get(SHOPURL,headers=headers)
images = R.html.find(#website information)
for image in images:
    print(image)

For each image that exists this is what is returned

<Element 'img' _ngcontent-app-c164='' deferload=''>

image filenames on website are stored under 'src"


Solution

  • Images are lazy loading, and behind an API request that must be authenticated with header information