我想从网页的HTML源代码中获取所有图像的URL列表(包括绝对和相对URL)。我使用Jsoup解析HTML,但它没有显示所有图像。例如,当我解析google.com的HTML源代码时,它显示零个图像。在google.com的HTML源代码中,图像链接的形式如下:
"background:url(/intl/en_com/images/srpr/logo1w.png)"
而在rediff.com中,图像链接的形式如下:
videoArr [j] = new Array("http://ishare.rediff.com/video/entertainment/bappi-da-the-first-indian-in-grammy-jury/2684982","http://datastore.rediff.com/h86-w116/thumb/5E5669666658606D6A6B6272/v3np2zgbla4vdccf.D.0.bappi.jpg","Bappi Da - the first Indian In Grammy jury","http://mypage.rediff.com/profile/getprofile/LehrenTV/12669275","LehrenTV","(2:33)"); j = 1 videoArr [j] = new Array("http://ishare.rediff.com/video/entertainment/bebo-shahid-jab-they-met-again-/2681664","http://datastore.rediff.com/h86-w116/thumb/5E5669666658606D6A6B6272/ra8p9eeig8zy5qvd.D.0.They-Met-Again.jpg","Bebo-Shahid : Jab they met again!","http://mypage.rediff.com/profile/getprofile/LehrenTV/12669275","LehrenTV","(2:17)");
并不是所有的图像都在“img”标签内。我还想提取甚至不在“img”标签内的图像,如上面的HTML源代码所示。
我该怎么做呢?请在此帮助我。谢谢。
"background:url(/intl/en_com/images/srpr/logo1w.png)"
而在rediff.com中,图像链接的形式如下:
videoArr [j] = new Array("http://ishare.rediff.com/video/entertainment/bappi-da-the-first-indian-in-grammy-jury/2684982","http://datastore.rediff.com/h86-w116/thumb/5E5669666658606D6A6B6272/v3np2zgbla4vdccf.D.0.bappi.jpg","Bappi Da - the first Indian In Grammy jury","http://mypage.rediff.com/profile/getprofile/LehrenTV/12669275","LehrenTV","(2:33)"); j = 1 videoArr [j] = new Array("http://ishare.rediff.com/video/entertainment/bebo-shahid-jab-they-met-again-/2681664","http://datastore.rediff.com/h86-w116/thumb/5E5669666658606D6A6B6272/ra8p9eeig8zy5qvd.D.0.They-Met-Again.jpg","Bebo-Shahid : Jab they met again!","http://mypage.rediff.com/profile/getprofile/LehrenTV/12669275","LehrenTV","(2:17)");
并不是所有的图像都在“img”标签内。我还想提取甚至不在“img”标签内的图像,如上面的HTML源代码所示。
我该怎么做呢?请在此帮助我。谢谢。