我在网页的源代码中找到了图像的地址。
相关内容如下:
<div class="fwr_page_box">
<div class="fwr_page" id="PageContainer_0" style="width: 1200px; height: 1696px; margin-left: 815px;">
<div id="Wrap_0" class="fwr_page_wrap border fwr_hidden" style="width: 1200px; height: 1696px;"></div>
<div class="loadingBg" id="loadingBg0" style="width:1200;height:1696;">
<img alt="" src="http://162.105.134.188/store/z6MY4xILLZ4Adov3uF7aOQ11/P01_00001.jpg" id="ViewContainer_BG_0" class="border fwr_page_bg_image">
</div>
</div>
</div>
然后,我可以使用chrome浏览器提取网址(http://162.105.134.188/store/z6MY4xILLZ4Adov3uF7aOQ11/P01_00001.jpg),然后手动下载。数字大小约为87 kb。
但是,当我尝试通过 wget 或 python urllib
批量下载这些图像时end_page = 117
for i in range(0,end_page,1):
os.system("wget http://162.105.134.188/store/z6MY4xILLZ4Adov3uF7aOQ11/P01_%s.jpg" %"{:05d}".format(i))
可以下载这些文件,而图形大小仅为82位,没有任何内容。
答案 0 :(得分:2)
带有图像的动态html由Javascript加载,而wget或urllib则不加载
使用selenium
模拟一个Chrome浏览器,然后从中提取内容