![](/img/trans.png)
[英]automatically get the href in <a> tag from the src of an <img> tag
[英]get the src from img tag
我正在使用ajax来抓取页面。
带有一张桌子的是我要抓取的imagesrc。。它被包裹在带有类名的A标签周围
我使用以下
$response.find(".infobox tr").each(function(){
$a=$(this).find(".image").html();
}
但它返回图像标记<img src="http://uwww.domain.com.au/image.jpg" height="333" width="256">
我已经尝试过attr(“ src”)和其他方法,但无济于事。
$a=$(this).find(".image img").attr("src")
尝试
$a=$(this).find(".image img").attr("src")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.