It seems like the data is hidden in <a>
nodes data-ids
attribute and later unpacked by javascript into a gallery of images.
<a href="/cto/6095960745.html" class="result-image gallery"
data-ids="1:01414_7WJQELsYuex,1:00t0t_kxF99J8uXmP,1:00S0S_dgnLA6FvDKX,1:00404_kTP1mB2Flpb,1:00P0P_j5On1SCHLuP,1:00a0a_jZYNazvdTgo,1:00Y0Y_9HJf6UJJVg7,1:00p0p_loCrLMXpS5s,1:00k0k_3e296xxBfXi,1:00f0f_5QpRYaBnIK7,1:00e0e_aZTOihYtz9C,1:00c0c_iatoB70CmWg,1:00X0X_dwt0ZbxYJNC,1:00k0k_k3dPBZpN9KM,1:00W0W_f51jQcPO86R">\n
<span class="result-price">$1700</span>\n </a>
We can reverse engineer this by extracting the ids and then formatting our own image urls:
ids = response.xpath("//a[@class='result-image gallery']/@data-ids").extract()
ids = ''.join(ids).split(',') # all of ids are separeted by comma
template = "https://images.craigslist.org/{}_300x300.jpg"
for img_id in ids:
# e.g. 1:00G0G_anZn4IdI4pK'
# we want to get rid of 1: part
img_id = img_id.split(':')[-1]
url = template.format(image id)
print(url)