Help scraping images with python behind a jquery javascript wall

Panther28

Elite Member
Executive VIP
Jr. VIP
Joined
May 2, 2010
Messages
10,052
Reaction score
16,218
I'm trying to get the following image:


Python:
<div class="fotorama" data-auto="false" data-nav="thumbs"></div>

<$cript data-async="false">

    jQuery('.fotorama').fotorama({

        data: [

                            {

                    img: 'https://www.website.com/uploads/image.png',

                    alt: 'This is the image text'

                },

        ]

    });

</$cript>


I'm using proxies, and soup, but with soup.findall('img'), but that doesn't return this image, only others outside the jquery on the page.

Any idea how to capture this correctly? Hopefully, I don't have to use selenium, as I can print the above code to the console, so I'm not sure why I can't get it out with a simple command?

I had to change the add $ to S on script keyword to get this to post, so don't point that error out please! :)

Cheers
 
The first thing you wanna do is get it as a BS element using this data-async="false" as an identifier for the element, then you wanna convert that element to a string, then you need to create a function that gets you the string between
img: ' and ',
which is 'https://www.website.com/uploads/image.png
 
Back
Top