从亚马逊网页抓取特定图像

时间:2015-04-21 18:00:34

标签: php dom web-scraping amazon

我正在尝试从以下来源中删除data-old-hiresdata-a-dynamic-image元素:

<img alt="Honeywell Long-Life Pure HEPA QuietCare Air Purifier, 17000" 
src="http://ecx.images-amazon.com/images/I/61qtgZMjVDL._SX425_.jpg"
data-old-hires="http://ecx.imagesamazon.com/images/I/61qtgZMjVDL._SL1280_.jpg" class="a-dynamic-image  a-stretch-vertical" id="landingImage" 
data-a-dynamic-image="{&quot;http://ecx.images-amazon.com/images/I/61qtgZMjVDL._SX466_.jpg&quot;:[466,466],&quot;http://ecx.images-amazon.com/images/I/61qtgZMjVDL._SX425_.jpg&quot;:[425,425],&quot;http://ecx.images-amazon.com/images/I/61qtgZMjVDL._SY450_.jpg&quot;:[450,450],&quot;http://ecx.images-amazon.com/images/I/61qtgZMjVDL._SX522_.jpg&quot;:[522,522],&quot;http://ecx.images-amazon.com/images/I/61qtgZMjVDL._SY355_.jpg&quot;:[355,355]}" style="max-height: 416px; max-width: 416px;">

但我收到一条错误消息,指出属于old的{​​{1}}和hires是未定义的变量。请帮助我检索data-old-hiresdata-old-hires元素。

以下是代码:

data-a-dynamic-image

0 个答案:

没有答案