[英]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.