I am trying to load player profile pictures from the following page:


I use the following code:

verein/985/saison_id/2006#", "Images"]

Unfortunately, all profile images are loaded as follows: enter image description here

All images I do not need are in the correct format...

The pause function (e.g., for one second)


only works between tasks. So I do not think I can use it.

Any ideas how to solve this issue?


1 Answer 1


If you write an HTML img tag like this:

<img src="url/to/image.jpg">

then the image will be downloaded directly upon page load. Some frontend developers don't like this as they think it's more important to quickly show the bulk of the page. The images can come later. So what they did in this case was writing

<img data-src="url/to/image.jpg">

They then use JavaScript to get the URLs from the data-src attributes and load the images that way. Clearly, this is not something that Import can figure out. However, using this knowledge, we can do it quite easily with jsoupLink:

<< jsoupLink`

html = Import[
images = html["Select", ".bilderrahmen-fixed"];
images = Import[#["Attribute", "data-src"]] & /@ images;
Partition[images, 8] // Grid

Mathematica graphics

  • $\begingroup$ Perfect, thanks a lot! $\endgroup$ Commented Aug 28, 2019 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.