phpquery如何获取img的src值?
我这样写报错,正确应该怎么写?
$a_img=pq(".show-content:eq(0) img:eq(0)")->getAttribute('data-original-src')
报错
Fatal error: Uncaught exception 'Exception' with message 'Method 'getAttribute' doesnt exist'
phpquery如何获取img的src值?
我这样写报错,正确应该怎么写?
$a_img=pq(".show-content:eq(0) img:eq(0)")->getAttribute('data-original-src')
报错
Fatal error: Uncaught exception 'Exception' with message 'Method 'getAttribute' doesnt exist'
pq(".show-content:eq(0) img:eq(0)")
这个部分没有取到值,看你是不是写错了,要结合你的html,另外就是调用的时机,是不是对应的图片还没有加载上来就调用了